These are chat archives for sandialabs/toyplot

8th
Jun 2017
Timothy M. Shead
@tshead2
Jun 08 2017 20:38
@dereneaton - okay, it’s a complicated story. My intent is to have two separate CSV download options for graphs, one for the vertices and one for the edges. Since the code is in front of me, I just went in and implemented vertex export. I’ll take a look at edge export later tonight (basically, the current client-side Javascript code assumes one export type per mark, and I need to remove that constraint). So that’s straightforward.
For Toytree, what you really want is some kind of API to allow you to add your own export file formats. That might-or-might-not involve some combination of Python and Javascript code (currently, the CSV files are dynamically generated on the client from the underlying data, using Javascript). Also, I’m under the impression that there isn’t a one-to-one mapping between Toytree tree vertices and Toyplot graph vertices, is that correct? That would be a good reason to want to disable the current vertex output.
Timothy M. Shead
@tshead2
Jun 08 2017 20:50
Plan B would be to alter the DOM created by toyplot.html.render() … which is a standard xml.etree.ElementTree object that can be manipulated however you like.
Plan C would be to derive your own class from toyplot.mark.Graph, and register a custom function to render it. The function implementation could use the Graph rendering code, then alter it. It would require a little bit of new Toyplot API to make this work, but it’s probably your best bet.