Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
e107d87
update react and create context
oprstchn Nov 8, 2018
fbbcfbb
add Provider
oprstchn Nov 8, 2018
f059bf5
remove provider
oprstchn Nov 11, 2018
175ca3e
connect To ContextType
oprstchn Nov 11, 2018
58ca319
fix eslint
oprstchn Nov 11, 2018
abb529c
remove test:jswatch
oprstchn Nov 11, 2018
2d2fb96
Merge branch 'fork_master' into feature/remove_contextTypees
oprstchn Nov 11, 2018
826794b
Merge pull request #3 from oprstchn/feature/remove_contextTypees
oprstchn Nov 11, 2018
a63e234
change peerDependencies
oprstchn Nov 11, 2018
f7239bc
update webpack 4 and webpack-dev-server v3
oprstchn Nov 11, 2018
ff83b6f
make:lib
oprstchn Nov 11, 2018
a529a8e
temporary change main point
oprstchn Nov 11, 2018
5a14605
add make files
oprstchn Nov 11, 2018
eafc0c2
add index.js
oprstchn Nov 11, 2018
3df797c
Remake
oprstchn Nov 11, 2018
ff7d646
remove context
oprstchn Nov 11, 2018
bf76d50
remake
oprstchn Nov 11, 2018
8614ed5
remake
oprstchn Nov 11, 2018
c861c06
add fold__top box-sizing:content-box
oprstchn Nov 12, 2018
8867201
remove Item.contextType
oprstchn Nov 12, 2018
40c5dba
add props updatePayload in PlotlyEditor
oprstchn Nov 12, 2018
45d0e4b
Merge pull request #4 from oprstchn/feature/update_datasource
oprstchn Nov 12, 2018
c9a7cdf
change handleDataSourceUpdate to handleUpdateActions
oprstchn Nov 14, 2018
176ea32
change handleDataSourceUpdate to handleUpdateActions
oprstchn Nov 14, 2018
f7f528a
remake
oprstchn Nov 14, 2018
0098581
remove lib
oprstchn Nov 15, 2018
6fa1ade
remove contextTypes in GraphCreatePanel;
oprstchn Nov 15, 2018
d55fa99
remove contextTypes in connector
oprstchn Nov 15, 2018
d4978c6
remove contextTypes
oprstchn Nov 16, 2018
a4d9b7e
pass to context in props
oprstchn Nov 19, 2018
927a0b8
fix UnconnnectedContainerVisibility-test
oprstchn Nov 19, 2018
1224183
fix tests
oprstchn Nov 20, 2018
83ce0e6
all test pass
oprstchn Nov 20, 2018
7579cae
remove contextTypes
oprstchn Nov 20, 2018
71aadd0
remove contextTypes and getChildContext
oprstchn Nov 20, 2018
ebeb8b3
fix TransformAccordion
oprstchn Nov 21, 2018
b4461ba
remove comment out
oprstchn Nov 21, 2018
1434b26
complete remove contextTypes and getChildContext
oprstchn Nov 21, 2018
d39719a
temporary checkin src in .npmignore
oprstchn Nov 21, 2018
2d5d3c0
remove optionalPanel
oprstchn Nov 21, 2018
b508121
remove unnecessary requireContext
oprstchn Nov 21, 2018
e9016d2
Merge remote-tracking branch 'upstream/master' into fork_master
oprstchn Nov 21, 2018
6fe11d4
Merge branch 'fork_master' into feature/migration_new_context_api
oprstchn Nov 21, 2018
805ef94
fix prop-types error
oprstchn Nov 22, 2018
c505ba6
fix prop-types in aggregationToTransform
oprstchn Nov 22, 2018
27cd1fb
update devDependency
oprstchn Nov 22, 2018
bdff282
Merge pull request #6 from oprstchn/feature/migration_new_context_api
oprstchn Nov 22, 2018
317b947
fix package.json
oprstchn Nov 22, 2018
42088d7
fix description
oprstchn Nov 22, 2018
68fe356
update percy
oprstchn Nov 24, 2018
2c8e276
fix UnconnectedVisibilitySelect
oprstchn Nov 25, 2018
97b4117
fix RangeSelectorAccordion
oprstchn Nov 25, 2018
75e9679
fix ImageStyles
oprstchn Nov 25, 2018
7d4ecc1
fix some context pass
oprstchn Nov 25, 2018
0cf1f13
fix colors in processing
oprstchn Nov 25, 2018
f89d10c
remove key
oprstchn Nov 25, 2018
ad1effc
change pacakge.json prop-types
oprstchn Nov 25, 2018
fbdc732
fix StyleTracePanel
oprstchn Nov 25, 2018
18bee1d
remove Field text
oprstchn Nov 25, 2018
c03d55b
add RecursiveComponent
oprstchn Nov 25, 2018
b9547af
update .gitignore
oprstchn Nov 26, 2018
0d12c92
fix UpdateMenuPanel
oprstchn Nov 26, 2018
3c2aeda
fix ColorBars
oprstchn Nov 26, 2018
36b5fa5
move circleci.yml to .circleci/config.yml
oprstchn Nov 26, 2018
17380d3
add sudo
oprstchn Nov 26, 2018
b11f046
apt-get install
oprstchn Nov 26, 2018
b7b7c3b
split apt
oprstchn Nov 26, 2018
4f27c4a
update prettier
oprstchn Nov 26, 2018
1c0f6ab
remove react-percy in package.json
oprstchn Nov 26, 2018
04bee52
update percy
oprstchn Nov 26, 2018
1f61ee6
avoid percy
oprstchn Nov 26, 2018
6f29fd5
Merge pull request #9 from oprstchn/fix/circleci
oprstchn Nov 26, 2018
6ca0995
add @percy/react-percy-ci
oprstchn Nov 26, 2018
70d2381
add percy-test
oprstchn Nov 26, 2018
1fd7113
avoid react-percy in circleci
oprstchn Nov 26, 2018
47dd6bf
fix
oprstchn Nov 27, 2018
dbf7fda
test circleci
oprstchn Nov 27, 2018
d0e1777
fix npm install order
oprstchn Nov 27, 2018
4eaf045
fix
oprstchn Nov 27, 2018
d467d3e
Merge pull request #8 from oprstchn/fix/reac-percy
oprstchn Nov 27, 2018
c3682bf
Merge remote-tracking branch 'upstream/master' into fork_master
oprstchn Nov 27, 2018
436f4b1
Merge branch 'feature/migration_new_context_api' into fork_master
oprstchn Nov 27, 2018
866c63b
all test resolved
oprstchn Nov 27, 2018
b18949f
fix lint
oprstchn Nov 27, 2018
b21428b
npm publish
oprstchn Nov 27, 2018
465122e
fix setPanel Consumer
oprstchn Dec 10, 2018
e9113d5
rename npm name
oprstchn Dec 10, 2018
96c5126
remove context
oprstchn Dec 11, 2018
18f7f8a
Merge branch 'master' into fork_master
oprstchn Jan 4, 2019
2864b8e
fix unused import
oprstchn Jan 4, 2019
e9137eb
fix add contextType in ColorscalePicker
oprstchn Jan 7, 2019
7cd9398
update version
oprstchn Jan 7, 2019
9e3a002
fix Y Bar Max
oprstchn Jan 7, 2019
061495c
fix aggregations
oprstchn Jan 8, 2019
ae4703d
update package
oprstchn Jan 8, 2019
de07289
add function
oprstchn Jan 9, 2019
ac3dcc3
For restore heatmap data
oprstchn Jan 9, 2019
edfbdc7
remove optionalPanel
oprstchn Feb 28, 2019
243abb3
Merge remote-tracking branch 'upstream/master' into v0.35.6
oprstchn Feb 28, 2019
a0d2940
fix warning
oprstchn Feb 28, 2019
f9b8471
Merge pull request #11 from oprstchn/fork_v0.35.6
oprstchn Feb 28, 2019
5f61fe1
fix version
oprstchn Feb 28, 2019
c232032
Merge remote-tracking branch 'upstream/master' into fork_master
oprstchn Mar 27, 2019
bf9097b
fix fontSelector
oprstchn Mar 27, 2019
9456d3c
delete .imi
oprstchn Mar 27, 2019
e740fe2
add DataSelect Styles
oprstchn Mar 28, 2019
f7b42ac
Merge branch 'fork_master' of ssh://github.com/oprstchn/react-chart-e…
oprstchn Apr 9, 2019
7ea47fd
Merge branch 'master' into fork_master
oprstchn Apr 29, 2019
2d5b568
fix mapがまだ治ってない
oprstchn Apr 29, 2019
ad7ada6
Merge branch 'fork_master' of ssh://github.com/oprstchn/react-chart-e…
oprstchn Apr 29, 2019
b4b3f59
fix test related map and geo
oprstchn Apr 29, 2019
f65e00e
add box-sizing
oprstchn Apr 29, 2019
041442f
Merge branch 'master' into fork_master
oprstchn May 14, 2019
91a9765
Merge branch 'master' into update_1906
oprstchn Jun 26, 2019
8e70293
Merge pull request #12 from oprstchn/update_1906
oprstchn Jul 1, 2019
0aff2c4
npm publish
oprstchn Jul 3, 2019
c81744b
Merge branch 'master' into fork_master
oprstchn Jul 3, 2019
f75bcf5
remove conflict marker
oprstchn Jul 3, 2019
2029238
update plotly.js
oprstchn Jul 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions circle.yml → .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
- v1-dependencies-

- run: npm install
- run: npm install --save-dev @percy/react
- run: npm rebuild node-sass

- save_cache:
paths:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ npm-debug.log*
!.storybook
!.gitignore
!.gitattributes
!.circleci
!.npmignore
!.eslintrc
!.eslintignore
Expand Down
22 changes: 2 additions & 20 deletions dev/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,27 +183,9 @@ class App extends Component {
// makeDefaultTrace={() => ({type: 'scattergl', mode: 'markers'})}
// fontOptions={[{label:'Arial', value: 'arial'}]}
// chartHelp={chartHelp}
// menuPanelOrder={menuPanelOrder}
>
<DefaultEditor
// menuPanelOrder={[
// {group: 'Dev', name: 'JSON'},
// {group: 'Dev', name: 'Inspector'},
// {group: 'Structure', name: 'Create'},
// {group: 'Structure', name: 'Subplots'},
// {group: 'Structure', name: 'Transforms'},
// {group: 'Test', name: 'Testing'},
// {group: 'Style', name: 'General'},
// {group: 'Style', name: 'Traces'},
// {group: 'Style', name: 'Axes'},
// {group: 'Style', name: 'Legend'},
// {group: 'Style', name: 'Color Bars'},
// {group: 'Style', name: 'Annotation'},
// {group: 'Style', name: 'Shapes'},
// {group: 'Style', name: 'Images'},
// {group: 'Style', name: 'Sliders'},
// {group: 'Style', name: 'Menus'},
// ]}
>
<DefaultEditor>
<Panel group="Dev" name="JSON">
<div className="mocks">
<Select
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "react-chart-editor",
"description": "plotly.js chart editor react component UI",
"version": "0.38.1",
"author": "Plotly, Inc.",
"name": "rcen",
"description": "fork from plotly.js chart editor react component UI by oprstchn",
"version": "0.38.2",
"author": "oprstchn",
"bugs": {
"url": "https://github.com/plotly/react-chart-editor/issues"
"url": "https://github.com/oprstchn/react-chart-editor/issues"
},
"dependencies": {
"@plotly/draft-js-export-html": "1.2.0",
Expand All @@ -15,7 +15,7 @@
"fast-isnumeric": "^1.1.2",
"immutability-helper": "^3.0.0",
"plotly-icons": "1.3.12",
"plotly.js": "1.48.3",
"plotly.js": "1.49.0",
"prop-types": "^15.7.2",
"raf": "^3.4.1",
"react-color": "^2.17.0",
Expand Down Expand Up @@ -82,10 +82,10 @@
"webpack-dev-server": "3.5.1"
},
"peerDependencies": {
"react": ">15",
"react-dom": ">15"
"react": ">=16.3.0",
"react-dom": ">=16.3.0"
},
"homepage": "https://plotly.github.io/react-chart-editor/",
"homepage": "https://oprstchn.github.io/react-chart-editor/",
"jest": {
"roots": [
"<rootDir>/src/"
Expand All @@ -109,7 +109,7 @@
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "https://github.com/plotly/react-chart-editor.git"
"url": "https://github.com/oprstchn/react-chart-editor.git"
},
"scripts": {
"lint": "prettier --write \"src/**/*.js\"",
Expand Down
1,401 changes: 703 additions & 698 deletions scripts/translationKeys/combined-translation-keys.txt

Large diffs are not rendered by default.

1,351 changes: 678 additions & 673 deletions scripts/translationKeys/translation-keys.txt

Large diffs are not rendered by default.

24 changes: 7 additions & 17 deletions src/DefaultEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ import {
} from './default_panels';
import {traceHasColorbar} from './default_panels/StyleColorbarsPanel';
import Logo from './components/widgets/Logo';
import {EditorControlsContext} from './context';
import {TRANSFORMABLE_TRACES, TRACE_TO_AXIS} from './lib/constants';

class DefaultEditor extends Component {
constructor(props, context) {
super(props, context);
constructor(props) {
super(props);
this.hasTransforms = this.hasTransforms.bind(this);
this.hasAxes = this.hasAxes.bind(this);
this.hasMenus = this.hasMenus.bind(this);
Expand All @@ -47,18 +48,13 @@ class DefaultEditor extends Component {
}

hasMenus() {
const {
fullLayout: {updatemenus = []},
} = this.context;
const {updatemenus = []} = this.context.fullLayout;

return updatemenus.length > 0;
}

hasSliders() {
const {
layout: {sliders = []},
} = this.context;

const {sliders = []} = this.context.layout;
return sliders.length > 0;
}

Expand All @@ -77,9 +73,8 @@ class DefaultEditor extends Component {
}

render() {
const _ = this.context.localize;
const logo = this.props.logoSrc && <Logo src={this.props.logoSrc} />;

const _ = this.context.localize;
return (
<PanelMenuWrapper menuPanelOrder={this.props.menuPanelOrder}>
{logo ? logo : null}
Expand Down Expand Up @@ -111,11 +106,6 @@ DefaultEditor.propTypes = {
menuPanelOrder: PropTypes.array,
};

DefaultEditor.contextTypes = {
localize: PropTypes.func,
fullData: PropTypes.array,
fullLayout: PropTypes.object,
layout: PropTypes.object,
};
DefaultEditor.contextType = EditorControlsContext;

export default DefaultEditor;
88 changes: 42 additions & 46 deletions src/EditorControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import nestedProperty from 'plotly.js/src/lib/nested_property';
import {categoryLayout, traceTypes} from 'lib/traceTypes';
import {ModalProvider} from 'components/containers';
import {DEFAULT_FONTS} from 'lib/constants';
import {EditorControlsContext} from './context';
import {recursiveMap} from './lib/recursiveMap';

class EditorControls extends Component {
constructor(props, context) {
Expand All @@ -32,27 +34,35 @@ class EditorControls extends Component {
}
}

getChildContext() {
componentWillReceiveProps(nextProps) {
const {updatePayload} = nextProps;
if (updatePayload && updatePayload.length > 0) {
this.handleUpdateActions(updatePayload);
}
}

provideValue() {
const gd = this.props.graphDiv || {};
return {
advancedTraceTypeSelector: this.props.advancedTraceTypeSelector,
config: gd._context,
srcConverters: this.props.srcConverters,
data: gd.data,
dataSourceComponents: this.props.dataSourceComponents,
dataSourceStyles: this.props.dataSourceStyles,
dataSourceOptions: this.props.dataSourceOptions,
dataSources: this.props.dataSources,
dictionaries: this.props.dictionaries || {},
localize: this.localize,
frames: gd._transitionData ? gd._transitionData._frames : [],
fullData: gd._fullData,
fullLayout: gd._fullLayout,
graphDiv: gd,
layout: gd.layout,
locale: this.props.locale,
localize: this.localize,
onUpdate: this.handleUpdate.bind(this),
plotSchema: this.plotSchema,
plotly: this.props.plotly,
plotSchema: this.plotSchema,
traceTypesConfig: this.props.traceTypesConfig,
showFieldTooltips: this.props.showFieldTooltips,
glByDefault: this.props.glByDefault,
Expand All @@ -62,6 +72,14 @@ class EditorControls extends Component {
};
}

handleUpdateActions(updatePayload) {
if (updatePayload && updatePayload.length !== 0) {
updatePayload.forEach(actions => {
this.handleUpdate(actions);
});
}
}

handleUpdate({type, payload}) {
const {graphDiv} = this.props;

Expand Down Expand Up @@ -337,19 +355,25 @@ class EditorControls extends Component {

render() {
return (
<div
className={
bem('editor_controls') +
' plotly-editor--theme-provider' +
`${this.props.className ? ` ${this.props.className}` : ''}`
}
>
<ModalProvider>
{this.props.graphDiv &&
this.props.graphDiv._fullLayout &&
(this.props.children ? this.props.children : <DefaultEditor />)}
</ModalProvider>
</div>
<EditorControlsContext.Provider value={this.provideValue()}>
<div
className={
bem('editor_controls') +
' plotly-editor--theme-provider' +
`${this.props.className ? ` ${this.props.className}` : ''}`
}
>
<ModalProvider>
{this.props.graphDiv &&
this.props.graphDiv._fullLayout &&
(this.props.children ? (
recursiveMap(this.props.children, this.provideValue())
) : (
<DefaultEditor />
))}
</ModalProvider>
</div>
</EditorControlsContext.Provider>
);
}
}
Expand Down Expand Up @@ -377,6 +401,7 @@ EditorControls.propTypes = {
fromSrc: PropTypes.func.isRequired,
}),
dataSourceComponents: PropTypes.object,
dataSourceStyles: PropTypes.object,
dataSourceOptions: PropTypes.array,
dataSources: PropTypes.object,
dictionaries: PropTypes.object,
Expand All @@ -391,6 +416,7 @@ EditorControls.propTypes = {
mapBoxAccess: PropTypes.bool,
fontOptions: PropTypes.array,
chartHelp: PropTypes.object,
updatePayload: PropTypes.array,
};

EditorControls.defaultProps = {
Expand All @@ -404,34 +430,4 @@ EditorControls.defaultProps = {
fontOptions: DEFAULT_FONTS,
};

EditorControls.childContextTypes = {
advancedTraceTypeSelector: PropTypes.bool,
config: PropTypes.object,
srcConverters: PropTypes.shape({
toSrc: PropTypes.func.isRequired,
fromSrc: PropTypes.func.isRequired,
}),
data: PropTypes.array,
dataSourceComponents: PropTypes.object,
dataSourceOptions: PropTypes.array,
dataSources: PropTypes.object,
dictionaries: PropTypes.object,
frames: PropTypes.array,
fullData: PropTypes.array,
fullLayout: PropTypes.object,
graphDiv: PropTypes.any,
layout: PropTypes.object,
locale: PropTypes.string,
localize: PropTypes.func,
onUpdate: PropTypes.func,
plotly: PropTypes.object,
plotSchema: PropTypes.object,
traceTypesConfig: PropTypes.object,
showFieldTooltips: PropTypes.bool,
glByDefault: PropTypes.bool,
mapBoxAccess: PropTypes.bool,
fontOptions: PropTypes.array,
chartHelp: PropTypes.object,
};

export default EditorControls;
6 changes: 6 additions & 0 deletions src/PlotlyEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class PlotlyEditor extends Component {
graphDiv={this.state.graphDiv}
dataSources={this.props.dataSources}
dataSourceOptions={this.props.dataSourceOptions}
dataSourceStyles={this.props.dataSourceStyles}
plotly={this.props.plotly}
onUpdate={this.props.onUpdate}
advancedTraceTypeSelector={this.props.advancedTraceTypeSelector}
Expand All @@ -40,6 +41,8 @@ class PlotlyEditor extends Component {
mapBoxAccess={Boolean(this.props.config && this.props.config.mapboxAccessToken)}
fontOptions={this.props.fontOptions}
chartHelp={this.props.chartHelp}
menuPanelOrder={this.props.menuPanelOrder}
updatePayload={this.props.updatePayload}
>
{this.props.children}
</EditorControls>
Expand Down Expand Up @@ -69,6 +72,7 @@ PlotlyEditor.propTypes = {
data: PropTypes.array,
config: PropTypes.object,
dataSourceOptions: PropTypes.array,
dataSourceStyles: PropTypes.object,
dataSources: PropTypes.object,
frames: PropTypes.array,
onUpdate: PropTypes.func,
Expand All @@ -91,6 +95,8 @@ PlotlyEditor.propTypes = {
glByDefault: PropTypes.bool,
fontOptions: PropTypes.array,
chartHelp: PropTypes.object,
menuPanelOrder: PropTypes.array,
updatePayload: PropTypes.array,
};

PlotlyEditor.defaultProps = {
Expand Down
29 changes: 14 additions & 15 deletions src/components/PanelMenuWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, {cloneElement, Component} from 'react';
import SidebarGroup from './sidebar/SidebarGroup';
import {bem} from 'lib';
import sortMenu from 'lib/sortMenu';
import {PanelMenuWrapperContext} from '../context';

class PanelsWithSidebar extends Component {
constructor(props) {
Expand All @@ -24,7 +25,7 @@ class PanelsWithSidebar extends Component {
this.setState({group, panel});
}

getChildContext() {
provideValue() {
return {
setPanel: this.setPanel,
};
Expand Down Expand Up @@ -85,16 +86,18 @@ class PanelsWithSidebar extends Component {
const menuOpts = this.computeMenuOptions(this.props);

return (
<div className={bem('editor_controls', 'wrapper')}>
<div className={bem('sidebar')}>{menuOpts.map(this.renderSection)}</div>
{React.Children.map(this.props.children, (child, i) =>
child === null ||
this.state.group !== child.props.group ||
this.state.panel !== child.props.name
? null
: cloneElement(child, {key: i})
)}
</div>
<PanelMenuWrapperContext.Provider value={this.provideValue()}>
<div className={bem('editor_controls', 'wrapper')}>
<div className={bem('sidebar')}>{menuOpts.map(this.renderSection)}</div>
{React.Children.map(this.props.children, (child, i) =>
child === null ||
this.state.group !== child.props.group ||
this.state.panel !== child.props.name
? null
: cloneElement(child, {key: i})
)}
</div>
</PanelMenuWrapperContext.Provider>
);
}
}
Expand All @@ -104,8 +107,4 @@ PanelsWithSidebar.propTypes = {
menuPanelOrder: PropTypes.array,
};

PanelsWithSidebar.childContextTypes = {
setPanel: PropTypes.func,
};

export default PanelsWithSidebar;
Loading