Code Monkey home page Code Monkey logo

nteract.io's Introduction

nteract.io

Welcome! This is the main site for nteract!

We serve an express app that does server rendered react using next and proxy https://nteract.github.io for all other routes. 😁

Development

git clone https://github.com/nteract/nteract.io
cd nteract.io
yarn
yarn dev

The yarn dev command starts a server locally. Navigate to localhost:8080 in your browser to view a development version of the site.

Deployment

We run nteract.io on now.sh. If your PR gets merged, it will automatically get deployed and if successful aliased as the 🆕 nteract.io. 🎉

Deploying by Hand

You'll need now to deploy:

npm install -g now

To do a test deployment run:

now

It should look like this:

$ now
> Deploying ~/code/src/github.com/nteract/nteract.io
> Using Node.js 7.6.0 (default)
> Ready! https://nteractio-tzdjehuhzz.now.sh (copied to clipboard) [928ms]
> Upload [====================] 100% 0.0s
> Sync complete (952B) [1s]
> Initializing…
> Building
> ▲ npm install
> ⧗ Installing:
>  ‣ express@^4.15.0
>  ‣ http-proxy@^1.15.1
>  ‣ next@^2.0.0-beta
>  ‣ react@^15.4.2
>  ‣ react-dom@^15.4.2
> ▲ npm install
> ⧗ Installing:
>  ‣ http-proxy@^1.15.1
>  ‣ express@^4.15.0
>  ‣ next@^2.0.0-beta
>  ‣ react@^15.4.2
>  ‣ react-dom@^15.4.2
> ✓ Installed 544 modules [9s]
> ▲ npm run build
> > [email protected] build /home/nowuser/src
> > next build
> (node:94) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
> parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
> ▲ npm start
> > [email protected] start /home/nowuser/src
> > NODE_ENV=production node index.js
> Deployment complete!

If you need to alias the site to make it live, verify that it's working then run:

now --prod

nteract.io's People

Contributors

aljohri avatar aulneau avatar azure-pipelines[bot] avatar bolariin avatar captainsafia avatar colombod avatar dependabot[bot] avatar dorafc avatar emeeks avatar exu3 avatar grabartley avatar ileasile avatar imgbotapp avatar ionicabizau avatar jdetle avatar jefftrevino avatar jruales avatar jzf2101 avatar lgeiger avatar renovate-bot avatar renovate[bot] avatar rgbkrk avatar rogererens avatar step21 avatar willingc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nteract.io's Issues

Update the installation instructions for desktop conda envs

If one double clicks to launch nteract, nteract does not launch within the conda environment (if activated). Instead it launches in the global space.

If one launches nteract via the CLI after activating the conda environment, nteract is working within the conda environment.

Fix flow setup

Currently flow-typed typings aren't used by flow. The flow-typed folder needs to be added to [libs] in our .flowconfig.

This will likely introduce some flow errors.

Alternatively we could move to typescript 😜

Update README

Our README is out of date. Deployments are now automatically happening via the now GitHub integration.

Revamp content on nteract.io website

Getting an issue for something that @MSeal, @wadethestealth, and I recently discussed on one of the team sites.

The nteract website hasn't undergone any major content changes for a couple of years now. In that time, the nteract ecosystem has evolved a ton. We now have a popular ecosystem of libraries, like Papermill and Scrapbook, a standardized JavaScript SDK for building notebook UIs, and a growing set of applications. We need to update our website to reflect these changes.

I went through each page of the website and made an audit of the segments of content that need to be changed.

  • Update text in hero segment to highlight core SDK first then desktop app second
  • Update three content headings in the homepage
    • First content section should be about core SDK
    • Second content section should be about applications like Hydrogen, nteract desktop, nteract play
    • Third content section should be about libraries like Papermill and Scrapbook
  • Update Desktop heading to "Applications"
    • Update text on heading to be "A beautiful notebook experience everywhere"
    • Update first content section to be about desktop app in general
    • Add section for nteract web app (currently in development but once it is done we should add it here)
    • Add section for nteract Jupyter extension
  • Update Atom heading to "Hydrogen"
    • I'll let @wadethestealth figure out what specific things to add under here.
  • Update components section to "core SDK"
    • First section should be about core SDK
    • Second section should be about React components
  • Add section for nteract libraries
    • First section should be about papermill
    • Section section should cover scrapbook
    • Extended section on bookstore, etc.
  • Update mission statement under "About" to be a paragraph and remove "We're people, not software" label
  • Fix whatever is going on with the contributors list that keeps breaking

Create a kernels page

On a /kernels page, list out kernels we support well:

  • IPython
  • IJavaScript
  • IJulia
  • IRkernel

I'm imagining a toggle to go between languages. I'll make a mockup later on.

showcase more features for the desktop app

Right now we show double-click to open. What else should we show to people?

Note that it's "as simple" as creating another React component like the other ones:

const OpenNotebooksFeature = () => (
<ContentSection>
<div className="panes center-vertically">
<div className="pane-30 pane">
<h3>Double Click</h3>
<p>Open notebooks natively on Mac, Windows, and Linux</p>
</div>
<div className="pane-70 pane">
<div className="section-graphic">
<video
style={{
boxShadow: "0 4px 14px 0 rgba(0,0,0,.1)",
transform: "translateX(50px)"
}}
src="/static/double-click-notebook.mp4"
autoPlay
loop
/>
</div>
</div>
</div>
</ContentSection>
);

Ideas:

  • Compatibility with Jupyter Notebooks
  • vdom support
  • Other output type support

For other ideas, also check out @captainsafia's post about the notebook

Link to NumFocus

We show the NumFocus logo in the bottom left corner, we should link to numfocus.org as well.

Instructions for installing cling kernel do not work

I followed the instructions for installing the cling (C++) kernel here:

Unfortunately, the kernel that is installed with these instructions is a Python one, not a C++ one.

If I source activate cling, then use jupyter notebook, then I see multiple C++ kernels labelled C++11, C++14, C++17. If I use jupyter lab, I see none of these. If I use nteract, I see none of these. Is there a way to expose these kernels to nteract?

Refine description of nteract project on home page

From discussion on Slack #random:

the nteract project, a set of JavaScript packages and applications for interacting with the Jupyter ecosystem

I also love this description of nteract. I've always thought of nteract as a set of tools first and a collection of applications of those tools (desktop, jext, hydrogen) second


This seems like a good thing to incorporate on the website landing page.

cc/ @MSeal @BenRussert

Fix desktop page

nteract.io:

screen shot 2018-10-17 at 4 50 17 pm

This PR:

screen shot 2018-10-17 at 4 49 57 pm

(Pardon the little 1.00 on the screen there, that's a chrome extension for video speed controller)

Anywho, I say this is fit to ship. Let's go for it!

Originally posted by @rgbkrk in #54 (comment)

Prefetch over http for https version.

Loading over https can be slow as Chrome complains:

Mixed Content: The page at 'https://nteract.io/' was loaded over HTTPS, but requested an insecure prefetch resource 'http://nteract.io/'. This content should also be served over HTTPS.

and indeed

  <!-- Prefetching, preloading, prebrowsing -->
  <link rel="dns-prefetch" href="//nteract.io/">
  <link rel="preconnect" href="http://nteract.io/">
  <link rel="prefetch" href="http://nteract.io/">
  <link rel="prerender" href="http://nteract.io/">
  <link rel="subresource" href="/assets/stylesheets/main.css">

Though I haven't found this in the source code.

Set up Google Analytics

Here's all the bits we need, though you'll probably have to change _document.js

gtag.js

// @flow
// nteract.io's GA Tracking ID (I just set this up)
export const GA_TRACKING_ID = "UA-129108362-1";

/**
 * pages/_document.js will load the google analytics adapter and use
 * nteract.io's tracking ID above.
 *
 * The following functions are helpers for submitting events and page views
 *
 * Usage:
 *   gtag.event({
 *      action: 'clone',
 *      category: 'workflow',
 *      label: 'test'
 *   })
 *
 */

// https://developers.google.com/analytics/devguides/collection/gtagjs/pages
export const pageview = url => {
  window.gtag("config", GA_TRACKING_ID, {
    page_location: url
  });
};

// https://developers.google.com/analytics/devguides/collection/gtagjs/events
export const event = ({ action, category, label, value }) => {
  window.gtag("event", action, {
    event_category: category,
    event_label: label,
    value: value
  });
};

pages/_app.js:

import * as React from "react";

import App, { Container } from "next/app";
import * as gtag from "../gtag";

import Router from "next/router";

Router.events.on("routeChangeComplete", url => gtag.pageview(url));

// This is the default setup, only placing it here to make the container nicer
// to work with
export default class MyApp extends App {
  static async getInitialProps({ Component, router, ctx }) {
    let pageProps = {};

    if (Component.getInitialProps) {
      pageProps = await Component.getInitialProps(ctx);
    }

    return { pageProps };
  }

  render() {
    const { Component, pageProps } = this.props;

    return (
      <Container>
        <Component {...pageProps} />
      </Container>
    );
  }
}

_document.js

import React from 'react'
import Document, { Head, Main, NextScript } from 'next/document'
import flush from 'styled-jsx/server'

import { GA_TRACKING_ID } from '../lib/gtag'

export default class extends Document {
  static getInitialProps ({ renderPage }) {
    const { html, head, errorHtml, chunks } = renderPage()
    const styles = flush()
    return { html, head, errorHtml, chunks, styles }
  }

  render () {
    return (
      <html>
        <Head>
          {/* Global Site Tag (gtag.js) - Google Analytics */}
          <script
            async
            src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`}
          />
          <script
            dangerouslySetInnerHTML={{
              __html: `
            window.dataLayer = window.dataLayer || [];
            function gtag(){dataLayer.push(arguments);}
            gtag('js', new Date());
            gtag('config', '${GA_TRACKING_ID}');
          `}}
          />
        </Head>
        <body>
          <Main />
          <NextScript />
        </body>
      </html>
    )
  }
}

Migrating to nteract's now account

This is a tiny ops log / plan. I'll update it as I go along.

Steps:

  1. Deploy nteract.io following guidance
  2. Deploy slackin to nteract account
  3. Attempt to switch domain
  4. Set DNS for deployments in (1) and (2)

Try out imgbot

I've enabled imgbot to send us PRs to suggest best practices for image page load.

Add snapshot testing for pages

We could have snapshot testing to ensure that regressions are less likely to happen.

Click tests are harder, and probably would benefit from automated testing.

Background color and inertia scrolling.

Nitpicking but when inertia-scrolling you can get some white at the top of the page (or bottom).
You can have a "cleaner" website by setting the background color as being the same as the header:

See example:

bgc

That's screwing other sections which needs to be colored, so no PR (for now), and the same happen in the footer at the bottom of the page... Not sure how to deal with it... gradient maybe ?

kernels/python instructions disregard virtualenv installs

I believe that most users follow one of the two modern methods of managing their Python installations: virtualenvs or Anaconda environments. Hopefully almost nobody runs

sudo pip install numpy

nowadays anymore.

For those users I find that the instructions on https://nteract.io/kernels/python follow an installation model that is not suitable to them.

The instructions ask the user to install an ipython kernel in their home directory using

python -m ipykernel install --user

This kernel will then become visible to all Hydrogen instances everywhere and overrides all other kernels in all other virtual environments, even if a local kernel is available. This can can create very messy situations with code inside a virtualenv run by an interpreter outside of it. And uninstalling an ipykernel kernel is much much harder than installing one.

The way I understand it, these instructions are only meant for users that do not run Atom from the commandline, and thus outside a virtualenv (which, admittedly, is probably a large number). I see that for them these instructions may be the only way to get Python kernels to work.

However for users that are using virtualenvs and are running Atom from inside one, these instructions can be very destructive. Instead of following the instructions, all they had to do was run

pip install jupyter

I believe the page should show more of the common possible scenarios and have installation instructions for them.

Fix next.js title error

When running the site, next.js throws the following warning:
Warning: <title> should not be used in _document.js's <Head>. https://err.sh/next.js/no-document-title

It looks like our Next.js setup can be greatly simplified since we're now fully on styled-components

Add links from nteract.io to documentation sites

From https://nteract.io/atom it would be great if there were a link to the Hydrogen documentation website https://nteract.gitbooks.io/hydrogen/. Currently I have to remember to go to the Github repo to find the link on the Readme.

I'm less sure about this but it might also be useful for https://nteract.io/desktop to have a link to something like https://components.nteract.io/?

Fix/remove `robots.txt` and `sitemap.xml`

Our server currently serves robots.txt and sitemap.xml.

nteract.io/server.js

Lines 10 to 20 in 48f98e0

if (!dev) {
/**
* Static Files
*/
server.get('/robots.txt', (req, res) => {
return res.sendFile('/static/robots.txt');
});
server.get('/sitemap.xml', (req, res) => {
return res.sendFile('/static/sitemap.xm');
});
}

Both files aren't generated at the moment. We should either remove this behavior or correctly generate them.

Add /web & other updates

Copying over from our meeting minutes, I thought this would be good to track here.

  • add landing page for jupyter server extension at /web
  • edit front page to mention web, desktop, components, hydrogen
  • feature Data Explorer, Papermill, workflows

Not able to run with listed steps in instruction

Running into following error post npm install, and while trying run - npm run start

/code/nteract.io/next.config.js:5
    webpack: (config, { dev }) => {
                      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:404:25)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at loadConfig 

Add Help button to the footer.

I really think it would help Nteract users if there was a help button on the footer or top of the page. We direct users to use Nteract and they are not aware of the Slack channel where questions can be asked.

Holoviews plots are outside cells and can't be cleared

I'm trying to make some plots with Holoviews, but the plots are placed at the bottom of my nteract window, outside the cell that generated them, and I can't seem to clear them.
I'm not sure if this is an issue with Holoviews or nteract, but things work as expected when running the notebook in my browser, so I'm guessing it's nteract.

I'm using nteract version 11.7 as an AppImage on Fedora 28. I tried the 11.6 AppImage as well, and the problem was there too.

Some example code:

import numpy as np
import holoviews as hv
hv.extension('bokeh')

data = [(chr(65+i), chr(97+j),  i*j) for i in range(5) for j in range(5) if i!=j]
hv.HeatMap(data).sort()

The plot gets shoved way to the bottom of the notebook, so much so that at normal zoom, I can't even capture the cell and the plot in the same screenshot. If I zoom out (Ctrl -), the distance between the cell and the plot actually increases - the cells seem to shrink towards the top while the plot shrinks towards the bottom. If I zoom in (Ctrl +) to comical levels, I can manage to get the bottom of the cell and the top of the plot in the same screenshot (attached).

Any idea what's going on?

cell (top) and plot (bottom) barely fit in

regular zoom of plot at bottom

Missing contributors on About page

It looks like the About page isn't displaying the full alpha list of contributors (contributors with gh user names >= 's')

Or maybe I've been demoted 😉

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.