Skip to content

Commit aa3d52b

Browse files
authored
Merge pull request #380 from plotly/rename
Rename react-plotly.js-editor to react-chart-editor
2 parents dfed73f + 8eb2252 commit aa3d52b

File tree

25 files changed

+455
-455
lines changed

25 files changed

+455
-455
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
# react-plotly.js-editor
1+
# react-chart-editor
22

33
> Customizable React-based editor panel for Plotly charts, Part of Plotly's [React Component Suite](https://plot.ly/products/react/) for building data visualization Web apps and products.
44
55
master
6-
![master](https://circleci.com/gh/plotly/react-plotly.js-editor/tree/master.svg?style=svg&circle-token=df4574e01732846dba81d800d062be5f0fef5641)
6+
![master](https://circleci.com/gh/plotly/react-chart-editor/tree/master.svg?style=svg&circle-token=df4574e01732846dba81d800d062be5f0fef5641)
77

88
## Demo & Screenshots
99

10-
Check out the [live demo here](https://plotly.github.io/react-plotly.js-editor/).
10+
Check out the [live demo here](https://plotly.github.io/react-chart-editor/).
1111

1212
![gif](examples/editor.gif)
1313

1414
## Quick start
1515

16-
Check out the demo of the latest release of the `DefaultEditor` at https://plotly.github.io/react-plotly.js-editor/ or run it locally with:
16+
Check out the demo of the latest release of the `DefaultEditor` at https://plotly.github.io/react-chart-editor/ or run it locally with:
1717

1818
```
1919
git clone [this repo]
20-
cd react-plotly.js-editor
20+
cd react-chart-editor
2121
cd examples/simple
2222
npm install
2323
npm start
2424
```
2525

2626
See more examples
27-
[here](https://github.com/plotly/react-plotly.js-editor/tree/master/examples).
27+
[here](https://github.com/plotly/react-chart-editor/tree/master/examples).
2828

2929
## Overview
3030

3131
This module's entry point is a React component called `<PlotlyEditor />` which connects to a [plotly.js](https://plot.ly/javascript/)-powered `<Plot />` component care of [`react-plotly.js`](https://github.com/plotly/react-plotly.js). A plotly.js plot is defined by a JSON-serializable object called a _figure_. `<PlotlyEditor />` accepts as children React components whose descendents are input elements wrapped via `connectToContainer()` calls so as to bind them to the `<Plot />`'s figure's values. If no children are passed to the `<PlotlyEditor />`, the `<DefaultEditor />` is used. This module also exposes the [building block components](#Built-in-Components) that comprise the `<DefaultEditor />` so that developers can create their own customized editors.
3232

3333
## Connecting `<PlotlyEditor />` to `<Plot />`
3434

35-
The binding between `<PlotlyEditor />` and `<Plot />` works a little differently that in most React apps because plotly.js mutates its properties. This is mapped onto React's one-way dataflow model via event handlers and shared revision numbers which trigger re-renders of mutated state. The following subset of the [simple example](https://github.com/plotly/react-plotly.js-editor/tree/master/examples/simple) shows how this works using a parent component to store state, but the principle is the same with a different state-manage approach, as shown in the [redux example](https://github.com/plotly/react-plotly.js-editor/tree/master/examples/redux):
35+
The binding between `<PlotlyEditor />` and `<Plot />` works a little differently that in most React apps because plotly.js mutates its properties. This is mapped onto React's one-way dataflow model via event handlers and shared revision numbers which trigger re-renders of mutated state. The following subset of the [simple example](https://github.com/plotly/react-chart-editor/tree/master/examples/simple) shows how this works using a parent component to store state, but the principle is the same with a different state-manage approach, as shown in the [redux example](https://github.com/plotly/react-chart-editor/tree/master/examples/redux):
3636

3737
```javascript
38-
import PlotlyEditor from 'react-plotly.js-editor';
38+
import PlotlyEditor from 'react-chart-editor';
3939
import Plot from 'react-plotly.js';
4040

4141
class App extends Component {
@@ -76,17 +76,17 @@ class App extends Component {
7676

7777
## Data Management
7878

79-
`<PlotlyEditor />` accepts a `dataSources` property which is an object of arrays of data, as well as a `dataSourceOptions` property which contains metadata about the `dataSources`, such as human-readable labels used to populate input elements like dropdown menus. `<PlotlyEditor />` treats these properties as immutable so any changes to them will trigger a rerender, and accepts an `onUpdateTraces` event handler property which is called whenever it needs to access a column from `dataSources`, enabling asynchronous data loading e.g. from remote APIs. The [async-data example](https://github.com/plotly/react-plotly.js-editor/tree/master/examples/async-data) shows how this is done using a dummy asynchronous back-end proxy.
79+
`<PlotlyEditor />` accepts a `dataSources` property which is an object of arrays of data, as well as a `dataSourceOptions` property which contains metadata about the `dataSources`, such as human-readable labels used to populate input elements like dropdown menus. `<PlotlyEditor />` treats these properties as immutable so any changes to them will trigger a rerender, and accepts an `onUpdateTraces` event handler property which is called whenever it needs to access a column from `dataSources`, enabling asynchronous data loading e.g. from remote APIs. The [async-data example](https://github.com/plotly/react-chart-editor/tree/master/examples/async-data) shows how this is done using a dummy asynchronous back-end proxy.
8080

8181
## Styling the `<DefaultEditor />` and the built-in components
8282

83-
* Import editor styles with `import react-plotly.js-editor/lib/react-plotly.js-editor.min.css`
84-
* Interested in [theming](https://github.com/plotly/react-plotly.js-editor/tree/master/THEMING.md)?
85-
* Need to support IE11? import the IE css instead: `import react-plotly.js-editor/lib/react-plotly.js-editor.ie.min.css`
83+
* Import editor styles with `import react-chart-editor/lib/react-chart-editor.min.css`
84+
* Interested in [theming](https://github.com/plotly/react-chart-editor/tree/master/THEMING.md)?
85+
* Need to support IE11? import the IE css instead: `import react-chart-editor/lib/react-chart-editor.ie.min.css`
8686

8787
## Development Setup
8888

89-
This repo contains a [dev app](https://github.com/plotly/react-plotly.js-editor/tree/master/dev) that depends on the components locally and is configured for hot reloading, for easy local development. A `jest`-based test suite is also included.
89+
This repo contains a [dev app](https://github.com/plotly/react-chart-editor/tree/master/dev) that depends on the components locally and is configured for hot reloading, for easy local development. A `jest`-based test suite is also included.
9090

9191
```
9292
npm install
@@ -109,7 +109,7 @@ At a pseudo-code level it looks like this:
109109
</PlotlyEditor>
110110
```
111111

112-
The [custom editor example](https://github.com/plotly/react-plotly.js-editor/tree/master/examples/custom) shows how to build a custom editor, and shows off all of the general-purpose containers and fields listed below.
112+
The [custom editor example](https://github.com/plotly/react-chart-editor/tree/master/examples/custom) shows how to build a custom editor, and shows off all of the general-purpose containers and fields listed below.
113113

114114
### General-purpose Containers
115115

THEMING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ You can inspect the editor and see a full listing of all variables that you can
8383
CSS custom properties are not supported in IE11. However, you can use a [PostCSS](https://github.com/postcss/postcss) plugin to convert the css properties to their true value when they are used. We are using [PostCSS Custom Properties](https://github.com/postcss/postcss-custom-properties).
8484

8585
The PostCSS plugin we are using only applies to variables that are in the `:root{}` scope. If you'd like to both theme and use your styles to support IE11, you would need to import the unminified IE styles we ship with the editor:
86-
`import react-plotly.js-editor/lib/react-plotly.js-editor.ie.css` (this stylesheet has the variables attached to the `:root{}` scope).
86+
`import react-chart-editor/lib/react-chart-editor.ie.css` (this stylesheet has the variables attached to the `:root{}` scope).
8787

8888
Then, rather than applying your custom properties to `.theme--dark .plotly-editor--theme-provider`, you would apply your overrides to `:root{}`.
8989

9090
Finally, you would pipe in the PostCSS plugin(s) to your project and produce a css file with the properties applied as their true value. It's recommended to use the [PostCSS Remove Root](https://github.com/cbracco/postcss-remove-root) plugin after you have converted all of the properties.
9191

92-
You can see our PostCSS scripts [here](https://github.com/plotly/react-plotly.js-editor/tree/master/scripts/postcss.js).
92+
You can see our PostCSS scripts [here](https://github.com/plotly/react-chart-editor/tree/master/scripts/postcss.js).

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
# specify the version you desire here
66
- image: circleci/node:8.9
77

8-
working_directory: ~/react-plotly.js-editor
8+
working_directory: ~/react-chart-editor
99

1010
steps:
1111
- checkout

dev/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import PlotlyEditor from '../src';
66
import '../src/styles/main.scss';
77
import Nav from './Nav';
88

9-
// https://github.com/plotly/react-plotly.js-editor#mapbox-access-tokens
9+
// https://github.com/plotly/react-chart-editor#mapbox-access-tokens
1010
import ACCESS_TOKENS from '../accessTokens';
1111

1212
const dataSources = {

examples/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# `react-plotly.js-editor` examples
1+
# `react-chart-editor` examples
22

3-
* [Simple `react-plotly.js-editor` example](simple): `DefaultEditor`, synchronous data, top-level component state management
4-
* [Async-data `react-plotly.js-editor` example](async-data): `DefaultEditor`, asynchronous data, top-level component state management
5-
* [Custom `react-plotly.js-editor` example](custom): `CustomEditor`, synchronous data, top-level component state management
6-
* [Redux `react-plotly.js-editor` example](redux): `DefaultEditor`, synchronous data, Redux state management
3+
* [Simple `react-chart-editor` example](simple): `DefaultEditor`, synchronous data, top-level component state management
4+
* [Async-data `react-chart-editor` example](async-data): `DefaultEditor`, asynchronous data, top-level component state management
5+
* [Custom `react-chart-editor` example](custom): `CustomEditor`, synchronous data, top-level component state management
6+
* [Redux `react-chart-editor` example](redux): `DefaultEditor`, synchronous data, Redux state management

examples/custom/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Custom `react-plotly.js-editor` example
1+
# Custom `react-chart-editor` example
22

33
This example built with [`create-react-app`](https://github.com/facebookincubator/create-react-app) uses a [customized editor](src/CustomEditor.js), with synchronously-loaded data and a top-level component for state, so as to demo the customizability of this component.
44

examples/custom/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"plotly.js": "^1.32.0",
77
"react": "^16.2.0",
88
"react-dom": "^16.2.0",
9-
"react-plotly.js-editor": "latest",
9+
"react-chart-editor": "latest",
1010
"react-plotly.js": "^1.2.0",
1111
"react-scripts": "1.0.17"
1212
},

examples/custom/src/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React, {Component} from 'react';
22
import plotly from 'plotly.js/dist/plotly';
33
import createPlotComponent from 'react-plotly.js/factory';
4-
import PlotlyEditor from 'react-plotly.js-editor';
4+
import PlotlyEditor from 'react-chart-editor';
55
import CustomEditor from './CustomEditor';
6-
import 'react-plotly.js-editor/lib/react-plotly.js-editor.css';
6+
import 'react-chart-editor/lib/react-chart-editor.css';
77

88
const dataSources = {
99
col1: [1, 2, 3], // eslint-disable-line no-magic-numbers

examples/custom/src/CustomEditor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
Button,
1717
SingleSidebarItem,
1818
TraceAccordion,
19-
} from 'react-plotly.js-editor';
19+
} from 'react-chart-editor';
2020

2121
export default class CustomEditor extends Component {
2222
render() {

examples/demo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Simple `react-plotly.js-editor` example
1+
# Simple `react-chart-editor` example
22

33
This example built with [`create-react-app`](https://github.com/facebookincubator/create-react-app) uses the `DefaultEditor`, with synchronously-loaded data and a top-level component for state, so as to demo the basic functionality of this component.
44

0 commit comments

Comments
 (0)