Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example #1

Open
wenlonghor opened this issue Jun 3, 2013 · 2 comments
Open

example #1

wenlonghor opened this issue Jun 3, 2013 · 2 comments

Comments

@wenlonghor
Copy link

could you put some example of isoline .thanks,wait for your reply

@solmsted
Copy link
Owner

solmsted commented Jun 3, 2013

These are the only examples I have at the moment:
http://jsfiddle.net/FhSLA/
http://jsfiddle.net/ULTgm/

gallery-isoline hasn't been updated in a while and it looks like there's a bug when using newer versions of YUI. Since there's some interest in it, I'll look at it this week.

@solmsted
Copy link
Owner

solmsted commented Jun 5, 2013

I've made code updates to fix the issue in newer versions of YUI. Yogi says the next gallery CDN deployment isn't until next week, so here's the new version minified:

YUI.add("gallery-isoline",function(e,t){(function(e){"use strict";var t="dataCellHeight",n="dataCellWidth",r=Math,i=e.Shape,s=r.ceil,o=r.max,u=r.min,a=parseInt,f=function(){f.superclass.constructor.apply(this,arguments)};e.Isoline=e.extend(f,i,{redraw:function(){return this._draw(),this},_draw:function(){var e=this,r=e.get(t)||1,i=e.get(n)||1,f=r/2,l=i/2,c=e.get("height"),h=e.get("width"),p=e.get("dataFn"),d=u(e.get("dataMaxX")||h,h),v=u(e.get("dataMaxY")||c,c),m=o(e.get("dataMinX")||0,0),g=o(e.get("dataMinY")||0,0),y=s((d-m)/i),b=s((v-g)/r),w,E,S=0,x,T;e.clear();for(;S<b;S+=1)for(E=0;E<y;E+=1)w="",x=m+E*i,T=g+S*r,w+=p(x-l,T-f)?1:0,w+=p(x+l,T-f)?1:0,w+=p(x+l,T+f)?1:0,w+=p(x-l,T+f)?1:0,w=a(w,2),(w===5||w===10)&&!p(x,T)&&(w*=4),w===1||w===14?e.moveTo(x-l,T).lineTo(x,T+f):w===2||w===13?e.moveTo(x,T+f).lineTo(x+l,T):w===3||w===12?e.moveTo(x-l,T).lineTo(x+l,T):w===4||w===11?e.moveTo(x,T-f).lineTo(x+l,T):w===5||w===40?e.moveTo(x-l,T).lineTo(x,T-f).moveTo(x,T+f).lineTo(x+l,T):w===6||w===9?e.moveTo(x,T-f).lineTo(x,T+f):w===7||w===8?e.moveTo(x-l,T).lineTo(x,T-f):(w===10||w===20)&&e.moveTo(x,T-f).lineTo(x+l,T).moveTo(x-l,T).lineTo(x,T+f);e.end()}},{ATTRS:e.mix({dataCellHeight:{value:1},dataCellSize:{setter:function(e){return this._set(t,e),this._set(n,e),e},value:1},dataCellWidth:{value:1},dataFn:{value:function(){return!1}},dataMaxX:{value:null},dataMaxY:{value:null},dataMinX:{value:null},dataMinY:{value:null}},i.ATTRS),NAME:"isoline"})})(e)},"",{requires:["graphics"]});

and the new version used in the two examples with YUI 3.10.2:

http://jsfiddle.net/FhSLA/1/
http://jsfiddle.net/ULTgm/1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants