Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export python code #75

Closed
reza1615 opened this issue Feb 21, 2020 · 11 comments
Closed

Export python code #75

reza1615 opened this issue Feb 21, 2020 · 11 comments

Comments

@reza1615
Copy link

Is it possible to add a feature to export the panda's code or mathplotlib's code for explored charts or filtering or groupby?
It can be like a popup text box in which the user can simply copy and paste the code to reuse it in the Jupyter notebook.

@aschonfeld
Copy link
Collaborator

I’ve actually been thinking a lot about that since i’ve developed similar stuff in the past.

I would love to add a dependency on matplotlib so I can export static images but it would require a lot of recoding of the plotly/dash stuff.

Maybe the code snippet is the best way to code so then the users can worry about converting it into a static image.

Great suggestion!

@reza1615
Copy link
Author

@aschonfeld: bamboolib is a good example for this request take a look on section Getting the Code

@aschonfeld
Copy link
Collaborator

@reza bamboolib has definitely been on my radar (wish it was free :)). I've been discussing how to attack the code export functionality and I think I've got a good idea on how to handle it (at least on the grid side of things. I'll essentially maintain a history of all the operations your running (if the manipulate the data in some way) and you'll be able to view that running log at any time also with the filtering & sorting information at the end.

As for the charts it shouldn't be much harder since isn't really a running history of operations you can perform on the data, just what the inputs allow. The tough part will be figuring out how to get the popup to play nice with plotly/dash.

But its certainly doable and I'll put it at the top of my list. Thanks for the feedback!

@reza1615
Copy link
Author

@aschonfeld
Copy link
Collaborator

@reza1615 just wanted to give you an update on where I'm at with the code export: https://youtu.be/z95sMY25Ab8

@reza1615
Copy link
Author

@aschonfeld: That is great.
Is it possible to keep the code in a text box instead of lable.
To have possiblity to edit or add before copy to clipboard.

@reza1615
Copy link
Author

I found https://community.plot.ly/t/syntax-highlighted-code-component-type/31035 for sintax highlighting for lable. may we can find some thing for textbox

@aschonfeld
Copy link
Collaborator

aschonfeld commented Feb 26, 2020

Not sure why you would want to edit it when you have the "Copy" button right in the bottom of the popup. You can click that and paste it anywhere you want and make edits from there.

Also, don't worry about the dash components. I think I've found a way around it to using the same component for the grid and the charts :)

aschonfeld pushed a commit that referenced this issue Feb 27, 2020
 * #75, added code snippet functionality to the following:
   * main grid, histogram, correlations, column building & charts
 * exposed CLI loaders through the following functions dtale.show_csv, dtale.show_json, dtale.show_arctic
   * build in such a way that it is easy for custom loaders to be exposed as well
 * #82, pinned `future` package to be >= 0.14.0
@aschonfeld aschonfeld mentioned this issue Feb 27, 2020
aschonfeld pushed a commit that referenced this issue Feb 27, 2020
 * #75, added code snippet functionality to the following:
   * main grid, histogram, correlations, column building & charts
 * exposed CLI loaders through the following functions dtale.show_csv, dtale.show_json, dtale.show_arctic
   * build in such a way that it is easy for custom loaders to be exposed as well
 * #82, pinned `future` package to be >= 0.14.0
@aschonfeld
Copy link
Collaborator

@reza1615 I have just relased version 1.7.11 which includes code snippets. Here's the links you'll find:

  1. in the main menu in the upper lefthand corner a "Code Export" button which houses all of the startup code as well as any new columns added and any sorting & filtering applied
  2. each grid/chart in the Correlations popup has a "Code Snippet" button for the code in (1) plus the code to generate that component
  3. "Code Snippet" button in Histogram popup which takes the output of (1) + all the code to generate the chart and description statistics in the popup
  4. "Code Snippet" in the Describe popup which takes the output of (1) plus the code to generate the statistics displayed for the popup
  5. "Code Snippet" in the Charts page for each chart you generate
  6. dynamic code displayed in the bottom righthand corner of the "Build Column" popup while you make your selections

If you're fine with what you see in this release I'll close this issue.

Thanks

@reza1615
Copy link
Author

Thanks. I tested that is great.
Is it possible to add syntax highlighting to the code box?

@aschonfeld
Copy link
Collaborator

@reza1615 just released 1.7.12 with syntax highlighting. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants