Skip to content

Commit 84429f0

Browse files
Merge pull request #90 from plotly/develop
Develop -> Master
2 parents cf9e198 + 697ee3d commit 84429f0

File tree

150 files changed

+5548
-8626
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+5548
-8626
lines changed

.eslintrc

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
{
2+
"extends": ["eslint:recommended", "prettier"],
3+
"parser": "babel-eslint",
4+
"parserOptions": {
5+
"ecmaVersion": 6,
6+
"sourceType": "module",
7+
"ecmaFeatures": {
8+
"arrowFunctions": true,
9+
"blockBindings": true,
10+
"classes": true,
11+
"defaultParams": true,
12+
"destructuring": true,
13+
"forOf": true,
14+
"generators": true,
15+
"modules": true,
16+
"templateStrings": true,
17+
"jsx": true
18+
}
19+
},
20+
"env": {
21+
"browser": true,
22+
"es6": true,
23+
"jasmine": true,
24+
"jest": true,
25+
"node": true
26+
},
27+
"globals": {
28+
"jest": true
29+
},
30+
"plugins": [
31+
"react",
32+
"import"
33+
],
34+
"rules": {
35+
"accessor-pairs": ["error"],
36+
"block-scoped-var": ["error"],
37+
"consistent-return": ["error"],
38+
"curly": ["error", "all"],
39+
"default-case": ["error"],
40+
"dot-location": ["off"],
41+
"dot-notation": ["error"],
42+
"eqeqeq": ["error"],
43+
"guard-for-in": ["off"],
44+
"import/named": ["off"],
45+
"import/no-duplicates": ["error"],
46+
"import/no-named-as-default": ["error"],
47+
"new-cap": ["error"],
48+
"no-alert": [1],
49+
"no-caller": ["error"],
50+
"no-case-declarations": ["error"],
51+
"no-console": ["error"],
52+
"no-div-regex": ["error"],
53+
"no-dupe-keys": ["error"],
54+
"no-else-return": ["error"],
55+
"no-empty-pattern": ["error"],
56+
"no-eq-null": ["error"],
57+
"no-eval": ["error"],
58+
"no-extend-native": ["error"],
59+
"no-extra-bind": ["error"],
60+
"no-extra-boolean-cast": ["error"],
61+
"no-inline-comments": ["error"],
62+
"no-implicit-coercion": ["error"],
63+
"no-implied-eval": ["error"],
64+
"no-inner-declarations": ["off"],
65+
"no-invalid-this": ["error"],
66+
"no-iterator": ["error"],
67+
"no-labels": ["error"],
68+
"no-lone-blocks": ["error"],
69+
"no-loop-func": ["error"],
70+
"no-multi-str": ["error"],
71+
"no-native-reassign": ["error"],
72+
"no-new": ["error"],
73+
"no-new-func": ["error"],
74+
"no-new-wrappers": ["error"],
75+
"no-param-reassign": ["error"],
76+
"no-process-env": ["warn"],
77+
"no-proto": ["error"],
78+
"no-redeclare": ["error"],
79+
"no-return-assign": ["error"],
80+
"no-script-url": ["error"],
81+
"no-self-compare": ["error"],
82+
"no-sequences": ["error"],
83+
"no-shadow": ["off"],
84+
"no-throw-literal": ["error"],
85+
"no-undefined": ["error"],
86+
"no-unused-expressions": ["error"],
87+
"no-use-before-define": ["error", "nofunc"],
88+
"no-useless-call": ["error"],
89+
"no-useless-concat": ["error"],
90+
"no-with": ["error"],
91+
"prefer-const": ["error"],
92+
"radix": ["error"],
93+
"react/jsx-no-duplicate-props": ["error"],
94+
"react/jsx-no-undef": ["error"],
95+
"react/jsx-uses-react": ["error"],
96+
"react/jsx-uses-vars": ["error"],
97+
"react/no-did-update-set-state": ["error"],
98+
"react/no-direct-mutation-state": ["error"],
99+
"react/no-is-mounted": ["error"],
100+
"react/no-unknown-property": ["error"],
101+
"react/prefer-es6-class": ["error", "always"],
102+
"react/prop-types": "error",
103+
"valid-jsdoc": ["error"],
104+
"yoda": ["error"],
105+
"spaced-comment": ["error", "always", {
106+
"block": {
107+
exceptions: ["*"]
108+
}
109+
}],
110+
"no-unused-vars": ["error", {
111+
"args": "after-used",
112+
"argsIgnorePattern": "^_",
113+
"caughtErrorsIgnorePattern": "^e$"
114+
}],
115+
"no-magic-numbers": ["error", {
116+
"ignoreArrayIndexes": true,
117+
"ignore": [-1, 0, 1, 2, 100, 10, 16, 0.5, 25]
118+
}],
119+
"no-underscore-dangle": ["off"]
120+
}
121+
}

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,28 @@ To build the dist version:
2727
$ npm run prepublish
2828
```
2929

30+
## Developer notes
31+
A PlotlyEditor widgets is composed of 3 layers:
32+
33+
### Layer 1: Base Component
34+
```
35+
<PlotlyEditor>
36+
```
37+
38+
### Layer 2: Container Components:
39+
One or more nested Container Components with one and only one connected by a connect<Container>ToPlot function (connectLayoutToPlot, connectTraceToPlot).
40+
```
41+
<Panel>, <Section>, <Fold>
42+
```
43+
44+
### Layer 3: Attribute Widgets
45+
Each connected by a `connectContainerToPlot` function
46+
<Numeric>, <ColorPicker>, <Radio> and remaining UI Controls
47+
```
48+
49+
Data flows via `context` downward and is augmented with additional information at each layer boundary.
50+
The Base Components aggregate references to the graphDiv objects (data, fullData, layout...), grid Data sources, locale, update functions etc. One of the Container Components uses its knowledge about which container to target (traces, layout, ...) to generate fewer but more specific containers and updaters which are passed down the hierarchy. The Attribute widgets are higher-order wrappers around dumb UI controls. The higher-order wrapper uses the container contexts and specific attributes information to provide specific plot update functions and other behaviours for the inner UI control.
51+
3052
## See also
3153
3254
- [plotlyjs-react](https://github.com/plotly/plotlyjs-react)

0 commit comments

Comments
 (0)