logarithmic y scale for graph

73 views
Skip to first unread message

Jerry Hicks

unread,
Jan 24, 2015, 4:36:13 PM1/24/15
to chap-link...@googlegroups.com
Hi,

I was wondering if anyone has implemented a logarithmic y scale for the 2 dimensional graph.

If it hasn't been implemented I was wondering if someone could lend some advise on what functions would need to overridden to implement plotting with a logarithmic scale for the y axis.

Thanks in advance

Jos de Jong

unread,
Jan 26, 2015, 4:43:18 AM1/26/15
to chap-link...@googlegroups.com
You will have to rewrite some parts of the function links.Graph.prototype._redrawVerticalAxis

You may be interested in the Graph2d of the successor of chap-links-library: vis.js. In this library you would have to adjust the method DataAxis.prototype._redrawLabels.

Jerry Hicks

unread,
Jan 26, 2015, 10:35:08 AM1/26/15
to chap-link...@googlegroups.com
Hi Jos,

thank you for the response.  I greatly appreciate it.  Looking further into the code it looks like I may need to play around with the StepNumber class as well.

Also I have definitely have looked at the vis.js library and it seems to provide a lot of good functionality and it was actually my first choice but it seems pretty hard to extend from because of it's member variables/properties are encapsulated within a closure and are thus inaccessible (This is more than likely by design).

In the contrast, the links.Graph  is designed using the prototypal style and thus makes it easier to extend from using OOP inheritance.  For instance, if I  wanted to add functionality to the  links.Graph draw method I could simply do:


MyGraph = Ext.extend(links.Graph, {  //ext
  
  draw : function(data, options) { 
     links.Graph.draw.call(this, data, options);  //call super method in links.Grap
     
     // place my code here
  }
});



If I could do the same with the vis.js graph without updating the vis.js file directly then I would definitely go with it


--
You received this message because you are subscribed to the Google Groups "CHAP Links Library" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chap-links-libr...@googlegroups.com.
To post to this group, send email to chap-link...@googlegroups.com.
Visit this group at http://groups.google.com/group/chap-links-library.
For more options, visit https://groups.google.com/d/optout.

Jos de Jong

unread,
Jan 26, 2015, 11:08:25 AM1/26/15
to chap-link...@googlegroups.com
You're welcome. All prototypes used in vis.js are exposed in the public api (see the file [index.js](https://github.com/almende/vis/blob/master/index.js)). And because the code is split in separate commonjs modules it is also easy to create your own bundle (see Custom Builds). This should give you more control to extend and customize vis.js as desired than was possible in chap-links-library.

Jerry Hicks

unread,
Jan 26, 2015, 11:12:51 AM1/26/15
to chap-link...@googlegroups.com
Very very interesting!  You've been so much help!

On Mon, Jan 26, 2015 at 11:08 AM, Jos de Jong <j...@almende.org> wrote:
You're welcome. All prototypes used in vis.js are exposed in the public api (see the file [index.js](https://github.com/almende/vis/blob/master/index.js)). And because the code is split in separate commonjs modules it is also easy to create your own bundle (see Custom Builds). This should give you more control to extend and customize vis.js as desired than was possible in chap-links-library.

--

Jos de Jong

unread,
Jan 26, 2015, 11:17:09 AM1/26/15
to chap-link...@googlegroups.com
have fun :)
Reply all
Reply to author
Forward
0 new messages