jamiewaese / ePlant

ePlant is a data visualization tool for integrating and exploring multiple levels of biological data.
MIT License
2 stars 1 forks source link

Get rid of Processing.js dependence for the ZUI framework #57

Closed yuzhenmi closed 10 years ago

yuzhenmi commented 10 years ago

As we've discussed before, Processing.js is not really necessary for our purpose, I don't think. I'll attempt to convert the ZUI framework to use native Canvas. I think this will give me more flexibility, in addition to disposing the strange error in Chrome when there is a touch event.

And... This is pretty cool! http://en.wikipedia.org/wiki/Point_in_polygon#Ray_casting_algorithm

I think it'll be useful for detecting mouse events.

yuzhenmi commented 10 years ago

I'm considering switching to KineticJS for the framework. It seems to have rich built-in features for SVGs, complex shapes, mouse events, mobile support, etc.

yuzhenmi commented 10 years ago

Or... I can write my own SVG path parser to create shape objects, and then use the Ray Casting Algorithm to detect mouse events. SVG mouse events handling is the main reason that I want to consider KineticJS, but after some thoughts, I realized KineticJS will put some constraints on the ZUI framework.

yuzhenmi commented 10 years ago

I decided to stick with native canvas for now. The SpeciesView is now running fully independent of Processing, using the new ZUI framework. I still have to modify the other views.

I've redesigned the ViewObject class (basically, a class for keeping track of shapes in the view) of the ZUI framework. ViewObjects are now event-driven and more abstracted than before (which means less effort to use them)!

yuzhenmi commented 10 years ago

ChromosomeView is now independent of Processing. All its popups are now using jQuery UI's Dialog (the styling for these dialogs can be adjusted by customizing the jQuery UI theme, right now it's using a standard theme called Smoothness hosted by Google). Still gotta fix the Get/Drop Data button and implement the new User Annotation feature (with the popup instead of text command).

yuzhenmi commented 10 years ago

Get/Drop Data button fixed. New User Annotation feature partially implemented (not sure how to let the user input color: color picker vs RGB values, and gotta do tags). It now supports input of multiple gene identifiers, separated by comma.

yuzhenmi commented 10 years ago

Wow! JSmol is just too evil... Earlier I reported that it conflicts with Cytoscape.js. Today, I confirmed that it OVERRIDES JavaScript's NATIVE prototype methods. Thanks to JSmol, I can't call Number's toString method which can convert a number to other bases (such as hexadecimal)! I can't imagine what else is broken by JSmol... Unfortunately there is no other alternative. This is really annoying because I will have to write my own hex converter, which is already provided in JavaScript's native library.

I'm using hex conversion for color input for the new Annotation feature, by the way.

yuzhenmi commented 10 years ago

Color now works for annotation. I used HTML5's color input as an easy way out.

jamiewaese commented 10 years ago

Has this been reported anywhere?

On Nov 11, 2013, at 6:57 PM, Hans Yu notifications@github.com wrote:

Wow! JSmol is just too evil... Earlier I reported that it conflicts with Cytoscape.js. Today, I confirmed that it OVERRIDES JavaScript's NATIVE prototype methods. Thanks to JSmol, I can't call Number's toString method which can convert a number to other bases (such as hexadecimal)! I can't imagine what else is broken by JSmol... Unfortunately there is no other alternative. This is really annoying because I will have to write my own hex converter, which is already provided in JavaScript's native library.

I'm using hex conversion for color input for the new Annotation feature, by the way.

— Reply to this email directly or view it on GitHub.

yuzhenmi commented 10 years ago

I don't know. I haven't seen any.