Skip to content

Commit

Permalink
website: Adopt gatsby-theme-ocular. Fix missing ToC entries. (#1311)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibgreen authored and tsherif committed Dec 9, 2019
1 parent 3f15fc4 commit cf83435
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 55 deletions.
8 changes: 4 additions & 4 deletions docs/table-of-contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
{
"title": "Overview",
"entries": [
{ "entry": "docs/README" },
{ "entry": "docs" },
{ "entry": "docs/whats-new" },
{ "entry": "docs/upgrade-guide" }
]
},
{
"title": "Tutorials",
"entries": [
{ "entry": "docs/get-started/README" },
{ "entry": "docs/get-started" },
{ "entry": "docs/get-started/hello-triangle" },
{ "entry": "docs/get-started/high-medium-low" },
{ "entry": "docs/get-started/hello-instancing-high" },
Expand All @@ -28,7 +28,7 @@
{
"title": "Overview",
"entries": [
{ "entry": "docs/api-reference/README" }
{ "entry": "docs/api-reference" }
]
},
{
Expand Down Expand Up @@ -113,7 +113,7 @@
{
"title": "Contributor Guide",
"entries": [
{ "entry": "docs/contributor-guide/README" }
{ "entry": "docs/contributor-guide" }
]
}
]
Expand Down
1 change: 0 additions & 1 deletion examples/getting-started/hello-instancing-low/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ export default class AppAnimationLoop extends MiniAnimationLoop {
}
}

/* global window */
if (typeof window !== 'undefined' && !window.website) {
const animationLoop = new AppAnimationLoop();
animationLoop.start();
Expand Down
1 change: 0 additions & 1 deletion examples/showcase/geospatial/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ export default class AppAnimationLoop extends MiniAnimationLoop {
}
}

/* global window */
if (typeof window !== 'undefined' && !window.website) {
const animationLoop = new AppAnimationLoop();
animationLoop.start();
Expand Down
1 change: 0 additions & 1 deletion examples/showcase/transform/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ function pickInstance(gl, pickX, pickY, model, framebuffer) {
}
}

/* global window */
if (typeof window !== 'undefined' && !window.website) {
const animationLoop = new AppAnimationLoop();
animationLoop.start();
Expand Down
16 changes: 8 additions & 8 deletions modules/experimental/src/gpgpu/histopyramid/histopyramid.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ function nextPowerOfTwo(x) {
}

const channelToIndexMap = {
['r']: 0,
['x']: 0,
['g']: 1,
['y']: 1,
['b']: 2,
['z']: 2,
['a']: 3,
['w']: 3
r: 0,
x: 0,
g: 1,
y: 1,
b: 2,
z: 2,
a: 3,
w: 3
};

// returns a base level texture that packs given weight into a texture
Expand Down
2 changes: 0 additions & 2 deletions website/gatsby-browser.js

This file was deleted.

13 changes: 10 additions & 3 deletions website/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
const {getGatsbyConfig} = require('ocular-gatsby/api');
const ocularConfig = require('./ocular-config');

const config = require('./ocular-config');
const GATSBY_CONFIG = {
plugins: [
{resolve: `gatsby-theme-ocular`, options: ocularConfig}
],
};

module.exports = getGatsbyConfig(config);
// NOTE: uncomment to debug config
// console.log(JSON.stringify(GATSBY_CONFIG, null, 2));

module.exports = GATSBY_CONFIG;
29 changes: 5 additions & 24 deletions website/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,10 @@
// NOTE: It is possible to override the ocular-provided callbacks
// and this take control any aspect of gatsby:

// exports.onCreateNode = ({ node, actions, getNode }) =>
// ocular.onCreateNode({ node, actions, getNode });

// exports.setFieldsOnGraphQLNodeType = ({ type, actions }) =>
// ocular.setFieldsOnGraphQLNodeType({ type, actions });

// // This is a main gatsby entry point
// // Here we get to programmatically create pages after all nodes are created
// // by gatsby.
// // We use graphgl to query for nodes and iterate
// exports.createPages = ({ graphql, actions }) =>
// ocular.createPages({ graphql, actions });
const {setOcularConfig} = require('gatsby-theme-ocular');
const {onCreateWebpackConfig} = require('gatsby-theme-ocular/gatsby-node');

const ocularConfig = require('./ocular-config');
const getGatsbyNodeCallbacks = require('ocular-gatsby/gatsby-node');

const callbacks = getGatsbyNodeCallbacks(ocularConfig);

module.exports = callbacks;

const onCreateWebpackConfig = callbacks.onCreateWebpackConfig;
setOcularConfig(ocularConfig);

callbacks.onCreateWebpackConfig = function onCreateWebpackConfigOverride(opts) {
module.exports.onCreateWebpackConfig = function onCreateWebpackConfigOverride(opts) {
onCreateWebpackConfig(opts);

const {
Expand Down Expand Up @@ -57,7 +38,7 @@ callbacks.onCreateWebpackConfig = function onCreateWebpackConfigOverride(opts) {
// Exclude all node_modules from transpilation, except for ocular
exclude: modulePath =>
/node_modules/.test(modulePath) &&
!/node_modules\/(ocular|ocular-gatsby|gatsby-plugin-ocular)/.test(modulePath)
!/node_modules\/(ocular|ocular-gatsby|gatsby-theme-ocular)/.test(modulePath)
});

// Omit the default rule where test === '\.jsx?$'
Expand Down
1 change: 0 additions & 1 deletion website/gatsby-ssr.js

This file was deleted.

12 changes: 6 additions & 6 deletions website/ocular-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ const ALIASES = require('ocular-dev-tools/config/ocular.config')({
// When duplicating example dependencies in website, autogenerate
// aliases to ensure the website version is picked up
// NOTE: module dependencies are automatically injected
// TODO - should this be automatically done by ocular-gatsby?
// TODO - should this be automatically done by gatsby-theme-ocular?
const dependencyAliases = {};
for (const dependency in DEPENDENCIES) {
dependencyAliases[dependency] = `${__dirname}/node_modules/${dependency}`;
}

module.exports = {
logLevel: 3, // Adjusts amount of debug information from ocular-gatsby
logLevel: 1, // Adjusts amount of debug information from ocular-gatsby

DOC_FOLDER: `${__dirname}/../docs/`,
ROOT_FOLDER: `${__dirname}/../`,
Expand Down Expand Up @@ -74,19 +74,19 @@ module.exports = {

PROJECTS: [
{
name: 'deck.gl',
title: 'deck.gl',
url: 'https://deck.gl'
},
{
name: 'luma.gl',
title: 'luma.gl',
url: 'https://luma.gl'
},
{
name: 'react-map-gl',
title: 'react-map-gl',
url: 'https://uber.github.io/react-map-gl'
},
{
name: 'react-vis',
title: 'react-vis',
url: 'https://uber.github.io/react-vis'
}
],
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
"@probe.gl/stats-widget": "^3.1.1",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"ocular-gatsby": "1.0.3",
"mapbox-gl": "^1.2.1"
},
"devDependencies": {
"gatsby": "^2.13.0",
"gatsby-theme-ocular": "^1.0.3",
"sharp": "^0.23.0"
}
}
2 changes: 1 addition & 1 deletion website/src/components/animation-loop-example-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class AnimationLoopExamplePage extends Component {
this.animationLoop._setDisplay(new VRDisplay());

// Ensure the example can find its images
// TODO - ideally ocular-gatsby should extract images from example source?
// TODO - ideally gatsby-theme-ocular should extract images from example source?
const {exampleConfig} = this.props;
if (exampleConfig && exampleConfig.path) {
const RAW_GITHUB = 'https://raw.githubusercontent.com/uber/luma.gl/master';
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/info-panel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default class InfoPanel extends PureComponent {
const { name, controls, sourceLink} = this.props;

return (
<div className="options-panel top-right" tabIndex="0">
<div className="options-panel top-right">
<h3>{name}</h3>
<div className="control-panel" dangerouslySetInnerHTML={{__html: controls}} />

Expand Down
2 changes: 1 addition & 1 deletion website/templates/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import {Home} from 'ocular-gatsby/components';
import {Home} from 'gatsby-theme-ocular/components';
import './style.css';

if (typeof window !== 'undefined') {
Expand Down

0 comments on commit cf83435

Please sign in to comment.