Comments (4)
I think we should try and minimize the number of imports that have to be written, try to avoid becoming messy like bokeh. Maybe have the widgets importable at top level since those will probably be used more frequently. Should see what we come up with for the events system as well in #39 and see where that will go.
from fastplotlib.
This sounds like a good strategy to me! The one question I have here is where the line is between things that would fall into the Plot and graphics functionality. E.g., again with my usual thought: try to emulate matplotlib where it is strong, but break from it where it is not (and where people don't really use it much anyway).
import fastplotlib.Plot as plot
plot = Plot()
plot.scatter() #does a scatter plot
plot.plot() # plots a line (don't make ppl think about what special objects are needed)
plot.imshow() # again, just let people do what they already expect
But then for special widgets with a ui component, you need widgets because matplotlib is not great, so you have special things for that, because you don't want to emulate matplotlib.
Anyway, just thinking out loud here as usual. I may well be wrong, esp as I am not yet a power user of fastplotlib.
from fastplotlib.
Kind of, this is how the simple plot functionality works:
from fastplotlib import Plot()
plot = Plot() # create a plotter
plot.image() # image plot
plot.line() # line plot, put on the same canvas since we're using the same plot instance
plot.scatter() # scatter plot, put on top of the previous
... etc.
It's similar to matplotlib but I think a bit more explicity, image
, line
, scatter
are the same exact names as the Graphic
classes. That's how it's actually implemented in the Plot
class anyways and probably makes it easy for a user to go between the simple Plot
interfaces and Graphics
if necessary.
For widgets, currently the image widget works like this:
from fastplotlib.widgets import ImageWidget
iw = ImageWidget(data=<data>, cmap="plasma")
# if it's a single data array, they can access the `Plot` instance of the imagewidget and add more things
iw.plot.line(data=<some line data>)
from fastplotlib.
Just using with recent changes, it seems there are a lot of imports I'm doing right now, e.g.,:
from fastplotlib import Plot
from fastplotlib.layouts import GridPlot
from fastplotlib.graphics import ImageGraphic
This seems like too much for the simplicity of what I'm trying to do.
I see the utility of having these layout/graphics things in separate modules, but I wonder if you might want to set up the package (with imports in __init__
) so people can just from fastplotlib import Plot, GridPlot, Image
and all the things, but also maybe more importantly for the future they can just import fastplotlib as fpl
and then just use these different widgets as needed? grid_plot = fpl.GridPlot(...things..)
.
FOr people that like to keep things logically ordered, they could still import as above.
from fastplotlib.
Related Issues (20)
- consider cmap library? HOT 2
- Tests: OSError: [Errno 24] Too many open files HOT 11
- consider descriptor pattern for `GraphicFeature`. HOT 7
- hard to interpret error in `Frame.show` HOT 4
- GraphicCollection.__del__ method can cause confusing tracebacks HOT 2
- Discussion on adding `xs`, `ys` and `zs` in Line and Scatter API HOT 2
- Automatically handle dataframe inputs for creating graphics HOT 1
- Install instructions HOT 1
- More flexibility for addWidget in Frame.show
- Get fastplotlib working in a docker container and binder or jupyterhub HOT 3
- Local git clone not working (Mac Arm) HOT 2
- Legends HOT 2
- Base class for moveable `Graphic` HOT 1
- Commit hooks that we need HOT 2
- Showing a list of fastplotlib ImageWidgets HOT 1
- pytest v8 compatibility
- Directly pass `Controller` instances to `GridPlot` HOT 2
- method for rotating graphics
- More repr stuff in html! HOT 1
- implement a pyinstaller hook like wgpu to just include all modules HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastplotlib.