Coder Social home page Coder Social logo

sandialabs / toyplot Goto Github PK

View Code? Open in Web Editor NEW
425.0 18.0 41.0 60.62 MB

Interactive plotting for Python.

Home Page: https://toyplot.readthedocs.io

License: Other

HTML 1.64% Python 18.11% Jupyter Notebook 78.61% Gherkin 1.63%
toyplot python scr-1658

toyplot's Introduction

Welcome!

Welcome to Toyplot, the kid-sized plotting toolkit for Python with grownup-sized goals:

  • Develop beautiful interactive, animated plots that embrace the unique capabilities of electronic publishing and support repoducibility.
  • Create the best possible data graphics “out-of-the-box”, maximizing data ink and minimizing chartjunk.
  • Provide a clean, minimalist interface that scientists and engineers will love.

You can see the full Toyplot documentation with tutorials at https://toyplot.readthedocs.io ... for questions, comments, or suggestions, get in touch with our team at https://gitter.im/sandialabs/toyplot.

toyplot's People

Contributors

ben-cunningham avatar dahuget avatar eaton-lab avatar harmsm avatar kannes avatar melund avatar stuntspt avatar tshead avatar tshead2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

toyplot's Issues

Explore latex support for text.

It should be possible to render text with Latex formatting using MathJax, if the text is embedded in our SVG using tags.

We will have to figure-out how to embed the MathJax, however.

Download CSV missing extension

This is a very minimal upgrade to do. I was just reading the "getting started" page and when I tried the "download CSV" feature of a plot by right clicking on the curve, it would download simply as "download" without extension. The document is still a csv, but it would be more user-friendly if the file was already marked as .csv.

Improve toyplot.locator.Log formatting.

Currently we use Unicode superscript characters to display log tick locators. However, many fonts don't supply every superscript character, so they are displayed using a mixture of fonts. We should render the superscripts explicitly so we have better control over formatting.

Unicode text doesn't work with the text mark.

It works fine as an axis label:

    axes = canvas.axes(ylabel=u"L\u0302")

but produces an error when used with the text mark:

    axes.text(x, y, u"L\u0302")
    UnicodeEncodeError: 'ascii' codec can't encode character u'\u0302' in position 1: ordinal not in range(128)

Add graph visualization to the API.

We now have a basic mark for rendering graphs. Missing in the current implementation:

  • Harmonize the API for specifying vertex / edge attributes with the plot / scatterplot API.
  • Support edge splines.
  • Specify graphs using just edges (create induced vertices automatically).
  • Allow arbitrary edge types, not just integer ids.
  • At least one high quality tree layout algorithm.
  • At least one high quality graph layout algorithm.
  • An option to explicitly specify vertex coordinates, so we can lay-out a graph once, and display it multiple times with a consistent layout.
  • Start / end markers to show edge direction.
  • Vertex labelling

Explore animation that moves points.

Note: for this to work, we either need to store the transformed points in the document, or a specification of how to transform the raw data.

We also need to address markers, where there are multiple drawing elements with a single logical location, and marks that are parameterized in ways other than just x,y coordinates, bar widths for example.

This is another argument in favor of simply rendering everything from scratch on the client side, instead of using the intermediate SVG representation.

Add support for general polygons.

Actually, more like polygons or squishy blobs that are the convex hull of a collection of points. This would facilitate analyzing clusters, both in graphs and scatterplots.

  • Implement a polygon mark type. Abusing the plot mark type doesn't make sense because plots are open and polygons are closed. Also, having multiple series doesn't make sense for polygons.
  • Should it be just straight lines, or splines, or ???
  • Provide functionality to create a polygon mark using a collection of points and a boundary distance.
  • It would be nice if the boundary distance could be constant in canvas space instead of domain space.

Implement interactive pan & zoom.

This implies updating the axes ticks / labels while panning / zooming.

In fact, doing this right may require us to just render everything client-side from the raw-data.

Explore graph marks.

We should have useful layout algorithms, e.g. force-directed, but with useful constraints / user guidance.

Table layout would be especially useful in the short-term for visualizing hierarchical clustering.

Change the fill(...) API to match plot(...)

Currrently, toyplot.axes.Cartesian.fill() and related functions treat two arguments as the upper and lower bounds of the fill. However, toyplot.axes.Cartesian.plot() treats two arguments as X and Y coordinates. Update fill() so two arguments are treated as X coordinates and the upper bounds, with lower bounds on the origin, so users can switch seamlessly between fill() and plot().

Make it explicit that canvas units are CSS pixels.

Although we've tried to be noncommittal about this, combining dimensionless units with CSS lengths in mark styles is ill-defined and misleading. Make it official that canvas drawing units are CSS pixels, and update the Cairo backend to reflect this.

Python 3 compatibility issue?

Toyplot looks pretty interesting. Unfortunately I did not yet manage to make it work on my environment.
I'm using python 3.4 from Macports on my Mac OS 10.10.3 . Using latest Ipython 3.x branch (but also tested unsuccessfully with earlier version 3.1 and 3.2). I get the following warning that seems to also prevent proper display in the notebook:

.../python3.4/site-packages/IPython/core/formatters.py:360: FormatterWarning: text/html formatter returned invalid type <class 'bytes'> (expected (<class 'str'>,)) for object: <toyplot.canvas.Canvas object at 0x1058b6518>
FormatterWarning

Is this related to a python 3 compatibility issue ?
Any help/suggestion/... would be appreciated.

Explore using axes to display statistics à la Tufte.

We currently display the data min/max using axes spines, but we could display additional descriptive statistics such as mean, median, quartiles, etc.

The tricky part is how to handle multiple series, i.e. do we want to display a single set of statistics summarizing all data in the plot or display per-series statistics using interaction?

Explore heat maps.

A colleague has convinced me that a heat map is distinctly different from setting background colors in a table. In a nutshell:

  • A heatmap is a continuous function sampled at arbitrary locations.

Move table and axes data out of the SVG markup and into the Javascript.

Currently, we store axes data and table data using custom SVG tags. However, they're only useful when part of an HTML document with Javascript to put them to use. So encode them directly in the HTML Javascript instead.

  • Switch to templates for externally-generated Javascript, to cleanup & organize the code.
  • Embed axes data in the Javascript.
  • Embed table data in the Javascript.

Style "opacity" doesn't create overlapping colors?

  • Create a scatterplot with points that overlap.
  • Style the points with "opacity" 0.5, color "black".
  • Expected behavior: overlapping points will produce darker colors.
  • Actual behavior: the overlapping points produce 50% gray.

This seems to be either a subtlety of CSS or a bug in the browser. Using "fill-opacity" produces expected results.

Switch to toyplot.data.Table for series storage.

Using toyplot.data.Table for series storage will have many benefits:

  • Explicit column labels when exporting the data from a figure.
  • Figure data may contain columns that aren't part of the figure.
  • Choosing which columns to use for the figure can be more flexible, e.g. series wouldn't have to share position coordinates.
  • Provides a clean mechanism to accept input from e.g. Pandas data frames.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.