|
From: Ethan A M. <merritt@u.washington.edu> - 2008-12-30 04:14:58
|
On Monday 29 December 2008, pl...@pi... wrote: > Hi Ethan, > > I have the basic mechanics in place to add some interactivity to > svg.trm, so I need to look at how to integrate this into the rest of > gnuplot. > > One of the main needs is to sprinkle a few id=xxx markers into the > various path and group elements so they can be identified and > modified via js and the DOM. > > If I want to add another arguement to the functions made visisble in > TERM_TABLE that would seem to mean changing every call and also the > terminals that dont support the new features. While feasible, it seems a > bit radical. You want to add one to every terminal function? That indeed sounds rather disruptive. Can you not achieve the same thing by creating a single new entry that passes in a cookie? > It is generally a good idea to have at least one 'joker' arguement as a > structure pointer in such interdependant interfaces. This allows for > future expansion without altering the prototypes and reorganising the > whole code structure. Opinions vary. The contrary argument is that if you have to put in slop variables, this just means that you have not put sufficient thought into getting the interface design right the first time. > This is certainly a result of a long running project that has evolved > well beyond it's original objectives. At some stage it may be worth > adding such extra args. > > > I had a look at the href patch which seems to work by adding a href > variable to some structures and an SVG_href() function to output the > xlink code. This works quite well for the labels and the command syntax > is clear but it looks less robust for more general entities like plots , > where trying to wrap it needs several flags to keep track of things. "A label" maps directly into a single call to the terminal. So it is easy to attach an additional to it, in this case xlink, and deliver it to the driver at the right time. "A plot" contains many, many calls to the terminal driver. If a driver needs to track whether it is currently in the context a plot, or a particular plot, it needs to maintain state variables. -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |