-
-
Notifications
You must be signed in to change notification settings - Fork 281
ChartEditor: use react-chart-editor #405
ChartEditor: use react-chart-editor #405
Conversation
Nice. It looks great. When you switch to the chart tab, should we
auto-minimize the table schema? `react-chart-editor` needs a good amount of
horizontal space and users might not now that they can collapse the table
schema sidebar.
…On Tue, Mar 13, 2018 at 1:51 PM, Nicolas Riesco ***@***.***> wrote:
@jackparmer <https://github.com/jackparmer> This is just to show you how
Falcon would look like with react-chart-editor.
See that I've made the Table view the default.
I'm also thinking of making the tree view as big as the code editor. So
that the chart editor can use the whole width.
@nicolaskruchten <https://github.com/nicolaskruchten> I'm looking forward
to the new API (it'd simplify this PR a lot).
[image: peek 2018-03-13 17-45]
<https://user-images.githubusercontent.com/6199391/37359812-782f9a1c-26e6-11e8-9b3f-e48275e62271.gif>
------------------------------
You can view, comment on, or merge this pull request online at:
#405
Commit Summary
- ChartEditor: WIP
File Changes
- *M* app/components/Settings/Preview/Preview.react.js
<https://github.com/plotly/falcon-sql-client/pull/405/files#diff-0>
(24)
- *A* app/components/Settings/Preview/chart-editor.jsx
<https://github.com/plotly/falcon-sql-client/pull/405/files#diff-1>
(134)
- *M* package.json
<https://github.com/plotly/falcon-sql-client/pull/405/files#diff-2>
(6)
- *M* webpack.config.base.js
<https://github.com/plotly/falcon-sql-client/pull/405/files#diff-3>
(7)
- *M* yarn.lock
<https://github.com/plotly/falcon-sql-client/pull/405/files#diff-4>
(1015)
Patch Links:
- https://github.com/plotly/falcon-sql-client/pull/405.patch
- https://github.com/plotly/falcon-sql-client/pull/405.diff
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#405>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABx4apFPzoyZIzzO4peWgRudX5EiAO8Bks5teAcqgaJpZM4SpKgR>
.
|
Awesome! New release coming soon with the new API /cc @VeraZab |
@jackparmer I thought about autominimise, but I was concerned some users might find difficult to discover that they can make the schema view visible again. That's why I thought making the schema view as big as the code editor would be the solution. |
That's why I thought making the schema view as big as the code editor
would be the solution.
Yeah, that sounds good to me.
…On Tue, Mar 13, 2018 at 2:10 PM, Nicolas Riesco ***@***.***> wrote:
@jackparmer <https://github.com/jackparmer> I thought about autominimise,
but I was concerned some users might find difficult to discover that they
can make the schema view visible again. That's why I thought making the
schema view as big as the code editor would be the solution.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#405 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABx4ajQCXkpwdfd467hxHfFGJ06oBpm_ks5teAuwgaJpZM4SpKgR>
.
|
@n-riesco just made a new release: https://www.npmjs.com/package/react-chart-editor |
* Implemented ChartEditor using `[email protected]`. * Enabled bundling of CSS by importing from a react component. * Use table view by default (instead of ChartEditor). Closes plotly#350
* Store gd in Settings state so that we can export the chart into Chart Studio.
* Removed obsolete props and state in Preview used by previous implementation of ChartEditor.
d963467
to
b5624fe
Compare
* Moved TableTree from Settings into Preview, so that all the components under the Query panel live inside Preview. * After this change, it'll be possible for move ChartEditor so that it fills all the available width.
* Hide code editor and schemas view, when the Chart Editor is selected.
@jackparmer I've updated the PR. In this end I've gone for the option of hiding both the code editor and the table schemas view (it didn't make sense to hide the code editor while the table schemas view was still visible) @nicolaskruchten @VeraZab As you can see in the screencast, I've got a problem with the initial plot size. Is there a way to set this size with the new API? |
|
@nicolaskruchten 😿 I still see the same behaviour after upgrading to |
@nicolaskruchten One thing, that is rather inconvenient with this workaround, is that I have to hard-code the height as |
What's the easiest way for me to get this running locally so I can play with the CSS? The height/width thing is a big pain point with this project in general :( |
@nicolaskruchten It turns out the issue isn't with the CSS. In fact, I have something working, but I'll clean it and push it into the PR tomorrow. |
* Fixes PlotlyComponent autosizing issue.
* Detect before render when chart panel becomes visible.
@nicolaskruchten In principle 85afe3b could be implemented inside I think the place to deal with this issue is inside To sum up the issue:
|
Seconded, this is a problem in the editor in general but I thought I'd more or less fixed it by firing |
* Preview.componentWillReceiveProps now checks if props have change before triggering a state update. * Do not pre-compute the CSV string (in order to reduce memory usage). Fixes plotly#395
* Restored previous name, because `gd` could suggest it's the DOM element. * `plotlyJSON` can be stringified safely.
@nicolaskruchten thanks for reviewing https://github.com/n-riesco/plotly-database-connector/blob/04dd2463ccddf834b19ef4111cffa989bf7f7fa6/app/components/Settings/Preview/chart-editor.jsx . I've renamed |
@shannonlal I'm done with this PR. Would you review it, please? |
@n-riesco Looking at this now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your throughts on define a standard for file name convention? Maybe out it in the contributing doc? I noticed that as you have be updating files you have been moving away from camel case file names to dash. I am okay with this, I just want to know if we should standardize on this. We updated chart-editor.css and Preview.css. I wanted to know if we should be making them consistent
}); | ||
|
||
// Cap plots to 100k rows | ||
const length = Math.min(rows.length, 100000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be defined as a const at top. const MAX_ROWS=10000;
<div | ||
ref={'container'} | ||
style={{ | ||
minHeight: 400, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a suggestion. Maybe a constant or move to a separate file. I see the min height of 400 defined in a bunch of files. Maybe we should centralize to a single file? your thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've re-enabled css-loader, so that we can import again .css
files into a component. But I didn't create a chart-editor.css
, because I feel we need tidy up the CSS in Falcon first:
- perhaps define a
.css
file with a common theme - follow Plotly's style guide
- Jack mentioned tachyons and I'm keen to give it a go.
import {Tab, Tabs, TabList, TabPanel} from 'react-tabs'; | ||
import ConnectionTabs from './Tabs/Tabs.react'; | ||
import UserConnections from './UserConnections/UserConnections.react'; | ||
import DialectSelector from './DialectSelector/DialectSelector.react'; | ||
import ConnectButton from './ConnectButton/ConnectButton.react'; | ||
import Preview from './Preview/Preview.react'; | ||
import TableTree from './Preview/TableTree.react.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this file no longer in use? I was working on some jest tests for table tree. If it is not needed I can move on to some other tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it's still in use (tests are always welcome 😄). I moved the import to Preview.react.js
. Now Preview.react.js
contains all the components displayed under the QUERY
tab.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing major. Just some minor comments and more questions about standards. I am going to give this a dancer now and let you make decision as to wether you want to fix my comments or move them to another issue. Overall a really nice job. 💃
columnNames = ['x', 'y']; | ||
|
||
rows = []; | ||
for (let i = 0; i < 100001; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be (MAX_LENGTH + 1)
@shannonlal I've addressed all your comments except that about CSS (I'd rather address it after we devise a plan to tidy up the CSS in Falcon; see what I replied here). |
Use ChartEditor, must connect plot site and logined ? |
@zhaodagang Falcon and
If you create an account on https://plot.ly/ and login with Falcon, then you'll be able to upload your data and charts onto https://plot.ly/ . |
Can this App connect clickhouse database ?
2018-05-09
zdg8882000
发件人:Nicolas Riesco <[email protected]>
发送时间:2018-05-08 23:43
主题:Re: [plotly/falcon-sql-client] ChartEditor: use react-chart-editor (#405)
收件人:"plotly/falcon-sql-client"<[email protected]>
抄送:"Mr Zhao"<[email protected]>,"Mention"<[email protected]>
@zhaodagang Falcon and react-chart-editor can be used without login.
react-chart-editor is based on the open-source library plotly.js.
If you create an account on https://plot.ly/ and login with Falcon, then you'll be able to upload your data and charts onto https://plot.ly/ .
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@jackparmer This is just to show you how Falcon would look like with
react-chart-editor
.See that I've made the Table view the default.
I'm also thinking of making the tree view as big as the code editor. So that the chart editor can use the whole width.
@nicolaskruchten I'm looking forward to the new API (it'd simplify this PR a lot).