Skip to content

Commit

Permalink
update storybook to v7++, commented out missing files for now to get …
Browse files Browse the repository at this point in the history
…storybook to run.

exclude config from linting.
  • Loading branch information
johannesleite committed Jan 23, 2024
1 parent 90c5b19 commit f7a0574
Show file tree
Hide file tree
Showing 9 changed files with 10,821 additions and 17,961 deletions.
15 changes: 15 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": 100
}
}
],
"@babel/preset-typescript"
],
"plugins": []
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
package-lock.json
tsconfig.json
test
rollup.config.js
76 changes: 65 additions & 11 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint/eslint-plugin"],
"plugins": [
"@typescript-eslint/eslint-plugin"
],
"env": {
"es6": true,
"node": true,
"browser": true
},
"extends": ["plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/recommended"],
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:storybook/recommended",
"plugin:storybook/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
Expand All @@ -21,22 +28,69 @@
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-unused-vars": ["error", { "args": "all", "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }],
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "all",
"varsIgnorePattern": "^_",
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/no-use-before-define": "off",

"curly": "error",
"no-continue": "off",
"no-plusplus": "off",
"no-param-reassign": "off",
"object-curly-newline": "off",
"no-underscore-dangle": "off",
"quotes": ["error", "single"],
"quotes": [
"error",
"single"
],
"import/prefer-default-export": "off",
"max-len": ["error", { "code": 150 }],
"comma-dangle": ["error", "always-multiline"],
"eqeqeq": ["error", "always", { "null": "ignore" }],
"no-magic-numbers": ["error", { "ignore": [-1, 0, 1], "ignoreDefaultValues": true }],
"newline-per-chained-call": ["off", { "ignoreChainWithDepth": 1 }],
"no-warning-comments": [0, { "terms": ["todo", "fixme"], "location": "start" }]
"max-len": [
"error",
{
"code": 150
}
],
"comma-dangle": [
"error",
"always-multiline"
],
"eqeqeq": [
"error",
"always",
{
"null": "ignore"
}
],
"no-magic-numbers": [
"error",
{
"ignore": [
-1,
0,
1
],
"ignoreDefaultValues": true
}
],
"newline-per-chained-call": [
"off",
{
"ignoreChainWithDepth": 1
}
],
"no-warning-comments": [
0,
{
"terms": [
"todo",
"fixme"
],
"location": "start"
}
]
}
}
3 changes: 0 additions & 3 deletions .storybook/config.js

This file was deleted.

13 changes: 13 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const config = {
stories: ['./src/*.stories.tsx'],

framework: {
name: '@storybook/html-webpack5',
options: {}
},

docs: {
autodocs: true
}
};
export default config;
34 changes: 17 additions & 17 deletions .storybook/src/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ const initialZoom: number = 12;

// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// Sample data
const faultlineDataTroll = require('./Samples/Troll-Faultlines.json');
const outlineDataTroll = require('./Samples/Troll-Outlines.json');
const wellboreDataTroll = require('./Samples/Troll-Wellbores.json');
const wbData = Object.values(wellboreDataTroll) as any[];
// const faultlineDataTroll = require('./Samples/Troll-Faultlines.json');
// const outlineDataTroll = require('./Samples/Troll-Outlines.json');
// const wellboreDataTroll = require('./Samples/Troll-Wellbores.json');
// const wbData = Object.values(wellboreDataTroll) as any[];
const licenseData = require('./.Samples/licenses.json');
const pipelineData = require('./.Samples/pipelines.json');
const facilityData = require('./.Samples/facilities.json');
const prospectData = require('./Samples/Prospects100.json');
// const prospectData = require('./Samples/Prospects100.json');

let explorationData = processExploration(
require('./Samples/Exploration.json'),
);
// let explorationData = processExploration(
// require('./Samples/Exploration.json'),
// );

explorationData = removeExpDuplicates(explorationData, wbData);
// explorationData = removeExpDuplicates(explorationData, wbData);
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

export const layer = () => {
Expand Down Expand Up @@ -145,13 +145,13 @@ export const layer = () => {
pixiLayer.addTo(map);

// fields.set(fieldData.features);
faultlines.set(faultlineDataTroll);
outlines.set(outlineDataTroll);
// faultlines.set(faultlineDataTroll);
// outlines.set(outlineDataTroll);

const split = Math.floor(wbData.length * 0.9);
// const split = Math.floor(wbData.length * 0.9);

const drilled = wbData.slice(0, split);
const planned = wbData.slice(split + 1, wbData.length);
// const drilled = wbData.slice(0, split);
// const planned = wbData.slice(split + 1, wbData.length);

wellbores.registerGroup('Drilled', {
order: 0,
Expand All @@ -173,7 +173,7 @@ export const layer = () => {
},
});

wellbores.set(drilled, 'Drilled'); // Set first half (Emulate 'Drilled')
// wellbores.set(drilled, 'Drilled'); // Set first half (Emulate 'Drilled')
// wellbores.set(planned, 'Planned'); // Set second half (Emulate 'Planned')
// wellbores.set(explorationData, 'Exploration');

Expand Down Expand Up @@ -370,7 +370,7 @@ export const layer = () => {
const licenseGeoJSON: SingleGeoJSON = { module: licenses, data: licenseData, props: licenseProps, visible: false };
const pipelineGeoJSON: SingleGeoJSON = { module: pipelines, data: pipelineData, props: pipelineProps, visible: false };
const facilityGeoJSON: SingleGeoJSON = { module: facilities, data: facilityData, props: facilityProps, visible: false };
const prospectGeoJSON: SingleGeoJSON = { module: prospects, data: prospectData, props: prospectProps, visible: false };
// const prospectGeoJSON: SingleGeoJSON = { module: prospects, data: prospectData, props: prospectProps, visible: false };

const toggleGeoJSON = (collection: any) => {
collection.visible = !collection.visible;
Expand All @@ -387,7 +387,7 @@ export const layer = () => {
groupGeoJSON.add('Toggle licenses', () => toggleGeoJSON(licenseGeoJSON));
groupGeoJSON.add('Toggle pipelines', () => toggleGeoJSON(pipelineGeoJSON));
groupGeoJSON.add('Toggle facilities', () => toggleGeoJSON(facilityGeoJSON));
groupGeoJSON.add('Toggle prospects', () => toggleGeoJSON(prospectGeoJSON));
// groupGeoJSON.add('Toggle prospects', () => toggleGeoJSON(prospectGeoJSON));
});

return root.node();
Expand Down
3 changes: 2 additions & 1 deletion .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ module.exports = ({ config }) => {
test: /\.(ts|tsx)$/,
use: [
{
loader: require.resolve('awesome-typescript-loader'),
loader: require.resolve('ts-loader'),
},
],
});
config.resolve.extensions.push('.ts', '.tsx');
config.resolve.extensions.push('.js', '.jsx');
return config;
};
Loading

0 comments on commit f7a0574

Please sign in to comment.