zimjs 20.0.1 → 20.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zimjs",
3
- "version": "20.0.1",
3
+ "version": "20.0.2",
4
4
  "type": "module",
5
5
  "main": "./src/zim.js",
6
6
  "types": "./ts-src/typings/zim",
package/src/zim.js CHANGED
@@ -13329,9 +13329,9 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
13329
13329
  if (prop=="stroke-opacity") aa = val;
13330
13330
  });
13331
13331
  return [f,s,ss,a,aa];
13332
- }
13332
+ }
13333
13333
 
13334
- function processShape(type, tag) {
13334
+ function processShape(type, tag) {
13335
13335
  var shape;
13336
13336
  var g = processGeneral(tag); // want ES6
13337
13337
  var f = g[0], s = g[1], ss = g[2], x = g[5], y = g[6];
@@ -13370,6 +13370,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
13370
13370
  if (p.indexOf(",") != -1) {
13371
13371
  zim.loop(p.split(" "), function (point) {
13372
13372
  var pp = point.split(",");
13373
+ if (!pp || pp.length<2) return;
13373
13374
  points.push([Number(pp[0].trim()), Number(pp[1].trim()),0,0,0,0,0,0,"none"]);
13374
13375
  });
13375
13376
  } else {
@@ -13518,9 +13519,10 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
13518
13519
  // kv comments: need to apply string cleansing, application bugs when there is a semi colon character used in tags.
13519
13520
  // get rid of semi colon,
13520
13521
  // any attributes on the tag overwrites styles or general
13521
- f = tag.getAttribute("fill")?tag.getAttribute("fill"):!zot(f)?f:generalFill;
13522
- s = tag.getAttribute("stroke")?tag.getAttribute("stroke"):!zot(s)?s:generalStroke;
13523
- ss = tag.getAttribute("stroke-width")?tag.getAttribute("stroke-width"):!zot(ss)?ss:generalStrokeSize;
13522
+ // was defaulting to generalFill, generalStroke, generalStrokeSize - made null in 020 patch
13523
+ f = tag.getAttribute("fill")?tag.getAttribute("fill"):!zot(f)?f:null;
13524
+ s = tag.getAttribute("stroke")?tag.getAttribute("stroke"):!zot(s)?s:null;
13525
+ ss = tag.getAttribute("stroke-width")?tag.getAttribute("stroke-width"):!zot(ss)?ss:null;
13524
13526
  a = tag.getAttribute("fill-opacity")?tag.getAttribute("fill-opacity"):!zot(a)?a:generalAlpha;
13525
13527
  aa = tag.getAttribute("stroke-opacity")?tag.getAttribute("stroke-opacity"):!zot(aa)?aa:generalStrokeAlpha;
13526
13528
 
@@ -25908,18 +25910,21 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
25908
25910
 
25909
25911
 
25910
25912
  /*--
25911
- zim.Emoji = function(code, size, monochrome, italic, backgroundColor, backgroundBorderColor, backgroundBorderWidth, corner, backing, padding, paddingH, paddingV, shiftH, shiftV, style, group, inherit)
25913
+ zim.Emoji = function(code, size, monochrome, italic, backgroundColor, backgroundBorderColor, backgroundBorderWidth, corner, backing, padding, paddingH, paddingV, shiftH, shiftV, color, borderColor, style, group, inherit)
25912
25914
 
25913
25915
  Emoji
25914
- zim class - extends a zim.Label which extends a zim.Container
25916
+ zim class - extends a zim.Container
25915
25917
 
25916
25918
  DESCRIPTION
25917
- Shows an emoji in a Label - an emoji is just text.
25918
- This helps treat the emoji as an image and works in conjunction with ZIM EmojiPicker
25919
+ Shows an emoji. Emojis are usually just text so it will be a Label in the Container.
25920
+ Support has been added in ZIM 020 for Noto Color Emojis - which are then added to the Container as SVG
25921
+ If color or borderColor is provided, the SVG will be an SVGContainer so independent parts can be colored, dragged or animated
25919
25922
 
25920
25923
  SEE: ZIM EmojiPicker() in COMPONENTS below ColorPicker().
25921
25924
 
25925
+ SEE: https://zimjs.com/emoji/ - Emoji Picker Tool
25922
25926
  SEE: https://zimjs.com/nft/bubbling/emoji.html
25927
+ SEE: https://zimjs.com/020/noto.html
25923
25928
 
25924
25929
  NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
25925
25930
 
@@ -25938,19 +25943,50 @@ new Emoji("\ud83c\udf47", 100) // grapes using UTF codes
25938
25943
  .drag();
25939
25944
  END EXAMPLE
25940
25945
 
25946
+ EXAMPLE
25947
+ // Go to https://emojipedia.org/ and find an emoji page
25948
+ // copy the emoji or use the copy link and paste into the string below
25949
+ // leave the noto_ at the start and paste the emoji icon right after the _
25950
+ // where icon is the actual emoji icon (or a unicode number, or a noto code)
25951
+ // this will create and SVG that is the same across platforms (Windows, Linux, Android, iOS)
25952
+ new Emoji("noto_icon")
25953
+ .center()
25954
+ .drag();
25955
+ // Note - if using with Tile() then preload the emoji in Frame assets of zapp_assets as "noto_icon"
25956
+ // where icon is the actual emoji icon (or a unicode number, or a noto code)
25957
+ END EXAMPLE
25958
+
25959
+ EXAMPLE
25960
+ // Go to https://zimjs.com/emoji/ and find press on an emoji
25961
+ // copy the emoji code and leave the noto_ at the start and paste the emoji code right after the _
25962
+ // setting color, will create an SVGContainer in the Emoji so individual parts can be colored
25963
+ new Emoji({code:"noto_\ud83e\udd51", color:series(red, blue, orange, purple, yellow)})
25964
+ .center()
25965
+ .expand(0) // blobs with interactive false do not get mouse, expand will give it a mouse for the drag
25966
+ .drag({all:true}); // without all:true would drag individual parts of the SVG
25967
+ END EXAMPLE
25968
+
25941
25969
  PARAMETERS
25942
25970
  ** supports DUO - parameters or single object with properties below
25943
25971
  ** supports OCT - parameter defaults can be set with STYLE control (like CSS)
25944
25972
  ** supports VEE - parameters marked with ZIM VEE mean a zim Pick() object or Pick Literal can be passed
25945
25973
  Pick Literal formats: [1,3,2] - random; {min:10, max:20} - range; series(1,2,3) - order, function(){return result;} - function
25946
25974
  code - |ZIM VEE| (default \ud83d\ude42") the Unicode Character or the Emoji from https://emojipedia.org/
25947
- or pass in UTF codes such as "\ud83d\ude42".
25948
- To convert from Unicode to UTF use https://zimjs.com/emoji/ (also see MORE link at bottom of page)
25975
+ or pass in UTF codes such as "\ud83d\ude42".
25976
+ To convert from Unicode to UTF use https://zimjs.com/emoji/
25977
+ This will add a ZIM Label with the character to the Emoji Container
25978
+ As of ZIM 020, this supports Noto (by Google) Color Emojis which stay consistent across platforms (Windows, Linux, Android, iOS)
25979
+ To turn the emoji into Noto emojis, use "noto_code" where code is the emoji character or a code described above
25980
+ This will add a ZIM SVG of the character to the Emoji Container
25981
+ If color or borderColor paramters are used, the SVG will be in the form of an SVGContainer holding ZIM Blob and Squiggle objects
25982
+ then each part can be colored, dragged, wiggled, or animated
25983
+ If using the Emoji in a Tile() or Wrapper() then preload the emoji in the Frame assets or zapp_assets using "noto_code"
25984
+ This will preload the SVG from the Google GitHub repository - the location is set in ZIM (similar to using "gf_" for Google fonts)
25985
+ NOTE: many of the parameters below will not work on the SVG as they were made for text based emojis (but color and borderColor will)
25986
+ see https://symbl.cc/en/platforms/google/ to see all - not easily searched though
25949
25987
  size - |ZIM VEE| (default 36) the size of the font in pixels
25950
25988
  monochrome - (default false) set to true to make black outline - this is actually the bold version of the icon
25951
25989
  italic - (default false) set the font to italic
25952
- ** SEE Label for the rest of the definitions
25953
- backgroundColor, corner, backing, padding, paddingH, paddingV, shiftH, shiftV, style, group, inherit
25954
25990
  backgroundColor - (default null) set to CSS color to add a rectangular color around the label
25955
25991
  The background color will change size to match the text of the label
25956
25992
  Note: the backgroundColor is different than a backing which can be any Display Object
@@ -25968,6 +26004,10 @@ paddingH - (default padding) places border out at top bottom
25968
26004
  paddingV - (default padding) places border out at left and right
25969
26005
  shiftH - (default 0) move the emoji inside the container horizontally
25970
26006
  shiftV - (default 0) move the emoji inside the container vertically
26007
+ color - |ZIM VEE| (default null) for when color is set, set to a color or an array of colors to apply to fill of children - in order of the children
26008
+ usually a series() would be used here for colors in order, or an array for random colors
26009
+ setting this will make an SVG with bitmap:false - so blobs and squiggles so parts of SVG can be colored
26010
+ borderColor - |ZIM VEE| (default null) for when borderColor is set to a color or an array of colors to apply to border of children - in order of the children
25971
26011
  style - (default true) set to false to ignore styles set with the STYLE - will receive original parameter defaults
25972
26012
  group - (default null) set to String (or comma delimited String) so STYLE can set default styles to the group(s) (like a CSS class)
25973
26013
  inherit - (default null) used internally but can receive an {} of styles directly
@@ -26001,8 +26041,8 @@ See the CreateJS Easel Docs for Container events such as:
26001
26041
  added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmove, pressup, removed, rollout, rollover
26002
26042
  --*///+54.58
26003
26043
 
26004
- zim.Emoji = function(code, size, monochrome, italic, backgroundColor, backgroundBorderColor, backgroundBorderWidth, corner, backing, padding, paddingH, paddingV, shiftH, shiftV, style, group, inherit) {
26005
- var sig = "code, size, monochrome, italic, backgroundColor, backgroundBorderColor, backgroundBorderWidth, corner, backing, padding, paddingH, paddingV, shiftH, shiftV, style, group, inherit";
26044
+ zim.Emoji = function(code, size, monochrome, italic, backgroundColor, backgroundBorderColor, backgroundBorderWidth, corner, backing, padding, paddingH, paddingV, shiftH, shiftV, color, borderColor, style, group, inherit) {
26045
+ var sig = "code, size, monochrome, italic, backgroundColor, backgroundBorderColor, backgroundBorderWidth, corner, backing, padding, paddingH, paddingV, shiftH, shiftV, color, borderColor, style, group, inherit";
26006
26046
  var duo; if (duo = zob(zim.Emoji, arguments, sig, this)) return duo;
26007
26047
  z_d("54.58");
26008
26048
 
@@ -26021,17 +26061,33 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
26021
26061
  if (zot(paddingV)) paddingV = DS.paddingV!=null?DS.paddingV:padding;
26022
26062
  if (zot(shiftH)) shiftH = DS.shiftH!=null?DS.shiftH:0;
26023
26063
  if (zot(shiftV)) shiftV = DS.shiftV!=null?DS.shiftV:0;
26064
+ if (zot(color)) color = DS.color!=null?DS.color:null;
26065
+ if (zot(borderColor)) borderColor = DS.borderColor!=null?DS.borderColor:null;
26024
26066
 
26025
26067
  // PICK
26026
26068
  var oa = remember(code, size);
26027
26069
  this.veeObj = {code:oa[0], size:oa[1]};
26028
26070
  function remember() {return arguments;} // for cloning PICK
26029
26071
  code = zim.Pick.choose(code);
26030
- size = zim.Pick.choose(size);
26072
+ size = zim.Pick.choose(size);
26031
26073
 
26032
- if (code.substring(0,2) == "U+") code = zim.unicodeToUTF(code);
26074
+ if (code.substring && code.substring(0,2) == "U+") code = zim.unicodeToUTF(code);
26075
+ this.zimContainer_constructor();
26076
+ // this.zimLabel_constructor(code, size, null, null, null, null, null, null, null, null, italic, null, null, null, backing, null, null, backgroundColor, null, null, corner, null, padding, paddingH, paddingV, shiftH, shiftV);
26077
+
26078
+ var that = this;
26079
+
26080
+ // SVG TEST
26081
+ var match;
26082
+ if (code.match) match = code.match(/^noto_(.*)/);
26083
+ if (match) {
26084
+ var svg = that.svg = new zim.SVG({svg:code, interactive:!(color||borderColor), bitmap:!(color||borderColor), color:color, borderColor:borderColor});
26085
+ svg.addTo(this);
26086
+ } else {
26087
+ var label = this.label = new zim.Label(code, size, null, null, null, null, null, null, null, null, italic, null, null, null, backing, null, null, backgroundColor, null, null, corner, null, padding, paddingH, paddingV, shiftH, shiftV);
26088
+ label.addTo(this);
26089
+ }
26033
26090
 
26034
- this.zimLabel_constructor(code, size, null, null, null, null, null, null, null, null, italic, null, null, null, backing, null, null, backgroundColor, null, null, corner, null, padding, paddingH, paddingV, shiftH, shiftV);
26035
26091
  this.type = "Emoji";
26036
26092
 
26037
26093
  // MONITOR
@@ -26039,12 +26095,12 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
26039
26095
 
26040
26096
  this.code = code;
26041
26097
  this.size = size;
26042
- var that = this;
26098
+
26043
26099
 
26044
26100
  var b = this.getBounds();
26045
26101
  var h = 5;
26046
26102
  var w = 3
26047
- this.bounds = this.setBounds(b.x+w,b.y-h+1,b.width-w*2,b.height+h);
26103
+ if (b) this.bounds = this.setBounds(b.x+w,b.y-h+1,b.width-w*2,b.height+h);
26048
26104
 
26049
26105
  if (monochrome) {
26050
26106
  this.saturation = -100;
@@ -26078,11 +26134,11 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
26078
26134
 
26079
26135
  if (style!==false) zim.styleTransforms(this, DS);
26080
26136
  this.clone = function (exact) {
26081
- return that.cloneProps(new zim.Emoji((exact||!zim.isPick(oa[0]))?code:oa[0], (exact||!zim.isPick(oa[1]))?that.size:oa[1], monochrome, italic, backgroundColor, backgroundBorderColor, backgroundBorderWidth, corner, backing, padding, paddingH, paddingV, shiftH, shiftV, style, that.group, inherit));
26137
+ return that.cloneProps(new zim.Emoji((exact||!zim.isPick(oa[0]))?code:oa[0], (exact||!zim.isPick(oa[1]))?that.size:oa[1], monochrome, italic, backgroundColor, backgroundBorderColor, backgroundBorderWidth, corner, backing, padding, paddingH, paddingV, shiftH, shiftV, color, borderColor, style, that.group, inherit));
26082
26138
  };
26083
26139
 
26084
26140
  };
26085
- zim.extend(zim.Emoji, zim.Label, ["clone","cache"], "zimLabel", false);
26141
+ zim.extend(zim.Emoji, zim.Container, ["clone","cache"], "zimContainer", false);
26086
26142
  //-54.58
26087
26143
 
26088
26144
  /*--
@@ -41567,7 +41623,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
41567
41623
  //-66.1
41568
41624
 
41569
41625
  /*--
41570
- zim.DPad = function(axis, width, backgroundColor, borderWidth, borderColor, indicatorColor, indicatorPressColor, indicatorScale, indicatorRadius, innerCircle, innerScale, activeRadius, clamp, logo, style, group, inherit)
41626
+ zim.DPad = function(axis, width, backgroundColor, borderWidth, borderColor, indicatorColor, indicatorPressColor, indicatorScale, indicatorRadius, innerCircle, innerScale, activeRadius, clamp, logo, useBubble, style, group, inherit)
41571
41627
 
41572
41628
  DPad
41573
41629
  zim class - extends a zim.Container which extends a createjs.Container
@@ -41577,8 +41633,10 @@ A DPad (Directional Pad) can be used to control x and y values
41577
41633
  This is primarily handy on mobile where a substitute for keypresses is needed
41578
41634
  The DPad can be set up for all directions, horizontal or vertical
41579
41635
  The DPad can be passed in to a ZIM MotionController to control an object
41636
+ There are default arrows but in ZIM 020 we added useBubble for a joystick like effect
41580
41637
 
41581
41638
  See: https://zimjs.com/ten/dpad.html
41639
+ See: https://zimjs.com/020/dpad.html
41582
41640
 
41583
41641
  NOTE: as of ZIM 5.5.0 the zim namespace is no longer required (unless zns is set to true before running zim)
41584
41642
 
@@ -41615,6 +41673,7 @@ innerScale - (default .5) the scale relative to the indicator
41615
41673
  activeRadius - (default width*2) radius at which the DPad works
41616
41674
  clamp - (default true) set to false to not limit the value between -1 and 1
41617
41675
  logo - (default false) set to true to show the letter D in the DPad - or add your own
41676
+ useBubble - (default false) set to true to use a joystick like effect (removes arrows)
41618
41677
  style - (default true) set to false to ignore styles set with the STYLE - will receive original parameter defaults
41619
41678
  group - (default null) set to String (or comma delimited String) so STYLE can set default styles to the group(s) (like a CSS class)
41620
41679
  inherit - (default null) used internally but can receive an {} of styles directly
@@ -41636,6 +41695,7 @@ type - holds the class name as a String
41636
41695
  dirX, dirY - the x and y values for the DPad - between -1 and 1 if clamp is set
41637
41696
  these can be multiplied by a factor to adjust speed - or use speed parameter of associated MotionController
41638
41697
  blendMode - how the object blends with what is underneath - such as "difference", "multiply", etc. same as CreateJS compositeOperation
41698
+ bubble - reference to the ZIM Circle if useBubble is set to true
41639
41699
  enabled - default is true - set to false to disable
41640
41700
 
41641
41701
  ALSO: see ZIM Container for properties such as:
@@ -41652,8 +41712,8 @@ dispatches a "change" event with dirX and dirY provided as well on the event obj
41652
41712
  ALSO: see the CreateJS Easel Docs for Container events such as:
41653
41713
  added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmove, pressup, removed, rollout, rollover
41654
41714
  --*///+66.2
41655
- zim.DPad = function(axis, width, backgroundColor, borderWidth, borderColor, indicatorColor, indicatorPressColor, indicatorScale, indicatorRadius, innerCircle, innerScale, activeRadius, clamp, logo, style, group, inherit) {
41656
- var sig = "axis, width, backgroundColor, borderWidth, borderColor, indicatorColor, indicatorPressColor, indicatorScale, indicatorRadius, innerCircle, innerScale, activeRadius, clamp, logo, style, group, inherit";
41715
+ zim.DPad = function(axis, width, backgroundColor, borderWidth, borderColor, indicatorColor, indicatorPressColor, indicatorScale, indicatorRadius, innerCircle, innerScale, activeRadius, clamp, logo, useBubble, style, group, inherit) {
41716
+ var sig = "axis, width, backgroundColor, borderWidth, borderColor, indicatorColor, indicatorPressColor, indicatorScale, indicatorRadius, innerCircle, innerScale, activeRadius, clamp, logo, useBubble, style, group, inherit";
41657
41717
  var duo; if (duo = zob(zim.DPad, arguments, sig, this)) return duo;
41658
41718
  z_d("66.2");
41659
41719
 
@@ -41682,11 +41742,12 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
41682
41742
  if (zot(activeRadius)) activeRadius = DS.activeRadius!=null?DS.activeRadius:width; // note, twice diameter
41683
41743
  if (zot(clamp)) clamp = DS.clamp!=null?DS.clamp:true;
41684
41744
  if (zot(logo)) logo = DS.logo!=null?DS.logo:false;
41745
+ if (zot(useBubble)) useBubble = DS.useBubble!=null?DS.useBubble:false;
41685
41746
 
41686
41747
  var that = this;
41687
41748
 
41688
41749
  this.axis = axis;
41689
- this.outer = new zim.Circle(width/2, backgroundColor, borderColor, borderWidth).addTo(this);
41750
+ var outer = this.outer = new zim.Circle(width/2, backgroundColor, borderColor, borderWidth).addTo(this);
41690
41751
  var inner = this.inner = new zim.Circle(width*innerScale/2, "rgba(0,0,0,.2)").center(this);
41691
41752
  if (logo) this.logo = new zim.Label({text:"D", bold:true}).center(inner).mov(1,2).alp(.3);
41692
41753
  var arrows = new zim.Container().addTo(this);
@@ -41700,6 +41761,41 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
41700
41761
  } else if (axis == "both") {
41701
41762
  numArrows = 4;
41702
41763
  }
41764
+ if (useBubble) {
41765
+ numArrows = 0;
41766
+ var bubble = that.bubble = new zim.Circle((outer.radius-inner.radius)/2-4, indicatorColor.toAlpha(.2), indicatorColor, 2).center(that);
41767
+ that.bubbleDampX = new zim.Damp();
41768
+ that.bubbleDampY = new zim.Damp();
41769
+ var r = outer.radius - bubble.radius - 4;
41770
+ that.down = false;
41771
+ that.bubbleDown = that.on("mousedown", function() {
41772
+ that.down = true;
41773
+ });
41774
+ that.bubbleUp = that.on("pressup", function() {
41775
+ that.down = false;
41776
+ });
41777
+
41778
+ // TODO - handle axis
41779
+
41780
+ that.bubbleTicker = zim.Ticker.add(function() {
41781
+ if (that.down) {
41782
+ var point = that.globalToLocal(that.stage.frame.mouseX, that.stage.frame.mouseY);
41783
+ bubble.loc(that.bubbleDampX.convert(point.x), that.bubbleDampY.convert(point.y));
41784
+ if (dist(0,0,bubble.x,bubble.y) > r) {
41785
+ var a = angle(bubble.x,bubble.y)*RAD
41786
+ var x = r*Math.cos(a);
41787
+ var y = r*Math.sin(a);
41788
+ that.bubbleDampX.immediate(x);
41789
+ that.bubbleDampY.immediate(y);
41790
+ bubble.loc(x,y)
41791
+ }
41792
+ } else {
41793
+ bubble.loc(that.bubbleDampX.convert(0), that.bubbleDampY.convert(0));
41794
+ }
41795
+ if (axis==HORIZONTAL) bubble.y = 0;
41796
+ else if (axis==VERTICAL) bubble.x = 0;
41797
+ });
41798
+ }
41703
41799
  zim.loop(numArrows, function (i, total) {
41704
41800
  new zim.Triangle(arrowSize, arrowSize, arrowSize, indicatorColor).addTo(arrows).reg(null, zot(indicatorRadius)?(width-borderWidth)*.475:indicatorRadius).rot(i*360/total);
41705
41801
  });
@@ -41766,7 +41862,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
41766
41862
 
41767
41863
  if (style!==false) zim.styleTransforms(this, DS);
41768
41864
  this.clone = function() {
41769
- return that.cloneProps(new zim.DPad(axis, width, backgroundColor, borderWidth, borderColor, indicatorColor, indicatorPressColor, indicatorScale, indicatorRadius, innerCircle, innerScale, activeRadius, clamp, logo, style, this.group, inherit));
41865
+ return that.cloneProps(new zim.DPad(axis, width, backgroundColor, borderWidth, borderColor, indicatorColor, indicatorPressColor, indicatorScale, indicatorRadius, innerCircle, innerScale, activeRadius, clamp, logo, useBubble, style, this.group, inherit));
41770
41866
  };
41771
41867
 
41772
41868
  this.dispose = function(a,b,disposing) {
@@ -56293,7 +56389,9 @@ NOTE: gesture() only works on the currentTarget - not a container's children (li
56293
56389
  ZIM Frame should have touch set to true (which is the default for mobile)
56294
56390
 
56295
56391
  NOTE: as of ZIM 020 - trackpad support has been added - pinch to zoom, swipe both fingers horizontally for rotate
56296
-
56392
+ ignores pinch point and operates from registration point no matter what the regControl is set at
56393
+ regControl is still used for touch screen
56394
+
56297
56395
  ALSO: see the noGesture() method to remove some or all gestures
56298
56396
 
56299
56397
  ALSO: see the gestureBoundary() method to set or reset the boundary rectangle dynamically
@@ -56334,6 +56432,7 @@ rect - (depreciated) same as boundary - kept for backwards compatibility
56334
56432
  trackPad - (default true) set to false to not handle trackpad on laptop
56335
56433
  trackpad supports pinch for zoom
56336
56434
  trackpad supports swipe horizontally with both fingers (the same way) for rotate
56435
+ Ignores regControl and operates from registration point
56337
56436
 
56338
56437
  EVENTS
56339
56438
  Adds move, scale and rotate events to obj (when associated gesture parameters are set to true)
@@ -56710,17 +56809,15 @@ zim.gesture = function(obj, move, scale, rotate, boundary, minScale, maxScale, s
56710
56809
  // Handles laptop trackpad two-finger gestures via wheel and gesturechange events.
56711
56810
  // Completely separate from the touch block above - own state, own canvas listeners.
56712
56811
  // Does not interfere with touchscreen gesture() behaviour.
56812
+ // Always transforms around the object's own (unaltered) registration point -
56813
+ // regControl is intentionally ignored here.
56713
56814
  // -----------------------------------------------------------------------
56714
56815
  if (trackpad && !obj.zimTouch.tpAttached) {
56715
56816
 
56716
56817
  // Separate matrix state - never shares with the touch block vars above
56717
- var tpMatrixStart;
56718
56818
  var tpStartScaleX;
56719
56819
  var tpStartScaleY;
56720
56820
  var tpStartRotation;
56721
- var tpStartRegX;
56722
- var tpStartRegY;
56723
- var tpLastPoint;
56724
56821
  var tpActive = false;
56725
56822
  var tpEndTimeout = null;
56726
56823
 
@@ -56729,10 +56826,6 @@ zim.gesture = function(obj, move, scale, rotate, boundary, minScale, maxScale, s
56729
56826
  var tpAccumScale = 1; // multiplicative accumulator, applied to tpStartScaleX/Y
56730
56827
  var tpAccumRot = 0; // degrees accumulator, applied to tpStartRotation
56731
56828
 
56732
- // Pivot in global stage coords - set once per session at first wheel event
56733
- var tpPivotGX = 0;
56734
- var tpPivotGY = 0;
56735
-
56736
56829
  // Safari GestureEvent state
56737
56830
  var tpGestureBaseScale = 1; // e.scale at gesturestart (always 1 per spec, but captured for safety)
56738
56831
  var tpGestureBaseRot = 0; // e.rotation at gesturestart (always 0 per spec)
@@ -56740,29 +56833,19 @@ zim.gesture = function(obj, move, scale, rotate, boundary, minScale, maxScale, s
56740
56833
  var tpGestureLastRot = 0; // e.rotation at previous gesturechange, for delta
56741
56834
  var tpGestureActive = false;
56742
56835
 
56743
- // Begin a trackpad gesture session: snapshot current object state
56744
- function tpBeginSession(pivotGX, pivotGY) {
56836
+ // Begin a trackpad gesture session: snapshot current object state.
56837
+ // No registration point manipulation - obj keeps whatever regX/regY it already has.
56838
+ function tpBeginSession() {
56745
56839
  tpActive = true;
56746
- tpPivotGX = pivotGX;
56747
- tpPivotGY = pivotGY;
56748
56840
  tpAccumScale = 1;
56749
56841
  tpAccumRot = 0;
56750
- tpStartScaleX = obj.scaleX;
56751
- tpStartScaleY = obj.scaleY;
56842
+ tpStartScaleX = obj.scaleX;
56843
+ tpStartScaleY = obj.scaleY;
56752
56844
  tpStartRotation = obj.rotation;
56753
- tpStartRegX = obj.regX;
56754
- tpStartRegY = obj.regY;
56755
- tpLastPoint = null;
56756
- if (!regControl) {
56757
- obj.reg(0,0);
56758
- tpMatrixStart = obj.getMatrix();
56759
- obj.regX = tpStartRegX;
56760
- obj.regY = tpStartRegY;
56761
- }
56762
56845
  }
56763
56846
 
56764
- // Apply accumulated scale + rotation to the object using the same
56765
- // matrix technique as the touch block's pressmove pair path
56847
+ // Apply accumulated scale + rotation to the object.
56848
+ // Always transforms around obj's current registration point - regControl is ignored.
56766
56849
  function tpApply() {
56767
56850
  if (!tpActive) return;
56768
56851
 
@@ -56781,35 +56864,12 @@ zim.gesture = function(obj, move, scale, rotate, boundary, minScale, maxScale, s
56781
56864
 
56782
56865
  var newRotation = tpStartRotation + tpAccumRot;
56783
56866
 
56784
- if (regControl) {
56785
- if (obj.zimTouch.scale) {
56786
- obj.scaleX = newScaleX;
56787
- obj.scaleY = newScaleY;
56788
- }
56789
- if (obj.zimTouch.rotate) {
56790
- obj.rotation = newRotation;
56791
- }
56792
- } else {
56793
- obj.reg(0,0);
56794
-
56795
- // Pivot point in global coords -> local to obj
56796
- var point = zot(tpLastPoint)
56797
- ? obj.globalToLocal(tpPivotGX, tpPivotGY)
56798
- : obj.globalToLocal(tpLastPoint.x, tpLastPoint.y);
56799
-
56800
- var matrix = tpMatrixStart.clone()
56801
- .translate(point.x, point.y)
56802
- .rotate(newRotation - tpStartRotation)
56803
- .scale(newScaleX / tpStartScaleX, newScaleY / tpStartScaleY)
56804
- .translate(-point.x, -point.y);
56805
-
56806
- matrix.decompose(obj);
56807
-
56808
- // Correct minor drift - same technique as touch block
56809
- tpLastPoint = obj.localToGlobal(point.x, point.y);
56810
-
56811
- obj.regX = tpStartRegX;
56812
- obj.regY = tpStartRegY;
56867
+ if (obj.zimTouch.scale) {
56868
+ obj.scaleX = newScaleX;
56869
+ obj.scaleY = newScaleY;
56870
+ }
56871
+ if (obj.zimTouch.rotate) {
56872
+ obj.rotation = newRotation;
56813
56873
  }
56814
56874
 
56815
56875
  if (obj.zimTouch.scale) obj.dispatchEvent("scale");
@@ -56820,6 +56880,7 @@ zim.gesture = function(obj, move, scale, rotate, boundary, minScale, maxScale, s
56820
56880
  if (obj.getStage && obj.stage) obj.stage.update();
56821
56881
  }
56822
56882
 
56883
+
56823
56884
  // End session: apply snapRotate and clean up
56824
56885
  function tpEndSession() {
56825
56886
  if (!tpActive) return;
@@ -56881,7 +56942,7 @@ zim.gesture = function(obj, move, scale, rotate, boundary, minScale, maxScale, s
56881
56942
  if (!obj.zimTouch.scale) return;
56882
56943
  e.preventDefault();
56883
56944
 
56884
- if (!tpActive) tpBeginSession(stagePos.x, stagePos.y);
56945
+ if (!tpActive) tpBeginSession();
56885
56946
  else if (tpEndTimeout) { clearTimeout(tpEndTimeout); tpEndTimeout = null; }
56886
56947
 
56887
56948
  // deltaY: negative = fingers spreading (zoom in), positive = fingers closing (zoom out)
@@ -56912,7 +56973,7 @@ zim.gesture = function(obj, move, scale, rotate, boundary, minScale, maxScale, s
56912
56973
  // rotates the way two physical fingers would twist a dial - counter-clockwise.
56913
56974
  e.preventDefault();
56914
56975
 
56915
- if (!tpActive) tpBeginSession(stagePos.x, stagePos.y);
56976
+ if (!tpActive) tpBeginSession();
56916
56977
  else if (tpEndTimeout) { clearTimeout(tpEndTimeout); tpEndTimeout = null; }
56917
56978
 
56918
56979
  tpAccumRot -= dx * 0.3; // degrees per CSS pixel - negative so direction matches natural two-finger twist
@@ -56953,7 +57014,7 @@ zim.gesture = function(obj, move, scale, rotate, boundary, minScale, maxScale, s
56953
57014
  tpGestureLastScale = e.scale;
56954
57015
  tpGestureLastRot = e.rotation;
56955
57016
  var stagePos = tpEventToStage(e);
56956
- if (!tpActive) tpBeginSession(stagePos.x, stagePos.y);
57017
+ if (!tpActive) tpBeginSession();
56957
57018
  if (tpEndTimeout) { clearTimeout(tpEndTimeout); tpEndTimeout = null; }
56958
57019
  };
56959
57020
 
@@ -76663,6 +76724,7 @@ dispatches a "moving" event if target is moving and "startmoving" and "stopmovin
76663
76724
  var frame = stage.frame;
76664
76725
 
76665
76726
  if (!zot(orient)) rotate = orient; // renamed parameter to orient
76727
+ if (zot(firstPerson)) firstPerson = false;
76666
76728
 
76667
76729
  if (zot(target)) {target = new zim.Container(1,1, null, null, false);} // make a surrogate if only wanting controller data
76668
76730
  var accelerator = target.type == "Accelerator";
@@ -76672,9 +76734,10 @@ dispatches a "moving" event if target is moving and "startmoving" and "stopmovin
76672
76734
  type = "manual";
76673
76735
  if (zot(axis)) axis = dPad.axis;
76674
76736
  if (axis == "all") axis = "both";
76675
-
76737
+ first = {rotation:0, speedX:that.speed, speedY:that.speed};
76676
76738
  dPad.on("change", function() {
76677
76739
  var d = {dirX:dPad.dirX, dirY:dPad.dirY};
76740
+ if (firstPerson) {doFirstPerson(d); return;}
76678
76741
  if (tileObj) {
76679
76742
  down = [0,0,0,0];
76680
76743
  var dC = false;
@@ -76695,6 +76758,7 @@ dispatches a "moving" event if target is moving and "startmoving" and "stopmovin
76695
76758
  that.convert(target.x+dPad.dirX*speed, target.y+dPad.dirY*speed);
76696
76759
  }
76697
76760
  }, null, null, null, null, mID);
76761
+
76698
76762
  if (tileObj) {
76699
76763
  dPad.on("pressup", function() {
76700
76764
  down = [0,0,0,0];
@@ -76723,8 +76787,7 @@ dispatches a "moving" event if target is moving and "startmoving" and "stopmovin
76723
76787
  if (zot(diagonal)) diagonal = true;
76724
76788
  if (axis == "horizontal" || axis == "vertical") diagonal = false;
76725
76789
  if (zot(damp) || damp===true) damp = (type=="keydown" || type=="gamebutton") ? 1: (type=="pressmove"?.5:.1);
76726
- if (damp === false) damp = 1;
76727
- if (zot(firstPerson)) firstPerson = false;
76790
+ if (damp === false) damp = 1;
76728
76791
  if (zot(turnSpeed)) turnSpeed = speed * .4;
76729
76792
  if (zot(moveThreshold)) moveThreshold = 4;
76730
76793
  if (zot(stickThreshold)) stickThreshold = tileObj?.3:.2;
@@ -91241,7 +91304,7 @@ assets - (default null) - 1. a string asset or 2. an array of assets, 3. ZIM ass
91241
91304
  2. ["logo.png", "bounce.mp3", "Reuben.otf"]
91242
91305
  3. {id:"string", src:"logo.png", path:"assets/", loadTimeout:2, noCORSonImage:true}
91243
91306
  4. [{assets:["one.png", "two.png"], path:"images/"}, {assets:["big.mp3", "oof.mp3"], path:"sounds/"}]
91244
- ** see the loadAssets() method for details - including more file types, etc.
91307
+ ** see the loadAssets() method for details - including more file types, Google fonts, Noto Emojis, etc.
91245
91308
  NOTE: "complete", "progress" and "fileLoaded" events are not dispatched
91246
91309
  use loadAssets() for these if desired
91247
91310
  the "ready" event will be dispatched when the canvas is ready and initial assets are loaded
@@ -91344,8 +91407,15 @@ loadAssets(assets, path, progress, xhr, time, loadTimeout, outputAudioSprite, cr
91344
91407
  assets - a file (url String, asset object or multi-asset object) or files in an Array
91345
91408
  each asset String is how you then access the asset with the asset() method of Frame
91346
91409
  asset types (from CreateJS PreloadJS): Image, Font, JSON, Sound, SVG, Text, XML
91347
- NOTE: as of ZIM ZIM 02, fonts can be loaded with just the font file name (including Google Fonts) rather than a ZIM font object - see FONTS in the Docs.
91410
+ NOTE: as of ZIM ZIM 02, fonts can be loaded with just the font file name (including Google Fonts)
91411
+ rather than a ZIM font object - see FONTS in the Docs.
91412
+ so for google fonts, use "gf_Font+Family" and then when assigning the font to the Label, use "Font Family" without the gf (+ is optional)
91348
91413
  NOTE: as of ZIM Cat 04, SVG will be automatically converted to a Bitmap with and svg property of the original SVG.
91414
+ NOTE: as of ZIM 020, Noto Color Emojis can be loaded with "noto_emoji"
91415
+ These look consistent across platforms (Windows, Linux, Android, iOS)
91416
+ Paste any emoji character or code after noto_ to preload the SVG for the emoji
91417
+ If color or borderColor is specified in the Emoji (or SVG) then individual parts
91418
+ can be colored, dragged, wiggled, or animated (see Emoji and SVG)
91349
91419
  asset can also be a ZIM asset object:
91350
91420
  {id:"string", src:"filename", path:"dir/", loadTimeout:1, maxNum:num, noCORSonImage:true}
91351
91421
  then can use the id to access the asset in the asset() method of Frame
@@ -91378,7 +91448,8 @@ loadAssets(assets, path, progress, xhr, time, loadTimeout, outputAudioSprite, cr
91378
91448
  ]
91379
91449
  ** then asset("one.png") will be the asset in the images folder
91380
91450
  ** and asset("portraits/one.png") will be the asset in the portraits folder
91381
- asset can also be a font object - but as of ZIM ZIM 02, fonts can be loaded with just the file name, including Google Fonts
91451
+ asset can also be a font object (DEPRECATED)
91452
+ As of ZIM ZIM 02, fonts can be loaded with just the file name, including Google Fonts ("gf_fontfamily")
91382
91453
  DO NOT use uppercase letters on mobile apps
91383
91454
  {font:name, src:url, type:string, weight:string, style:string} // with last three properties being optional
91384
91455
  eg.
@@ -91386,6 +91457,7 @@ loadAssets(assets, path, progress, xhr, time, loadTimeout, outputAudioSprite, cr
91386
91457
  {font: "regu", src:"regul-bold.woff", weight:"bold"}
91387
91458
  {src:"https://fonts.googleapis.com/css?family=Roboto"}
91388
91459
  For google fonts https://fonts.google.com/ you add extra information to the url so the font (family), type, weight and style are ignored
91460
+ It is easier to just load google fonts as "gf_fontfamily" as an asset
91389
91461
  If absolute src is used, path parameter is ignored - otherwise path is added to start of src
91390
91462
  After loading, can just use:
91391
91463
  var label = new Label("hello", 30, "wildwood") // or whatever the font property is
@@ -92432,6 +92504,56 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
92432
92504
  that.dispatchEvent("update");
92433
92505
  };
92434
92506
 
92507
+ // Made by AI - Gemini - used to load Noto Emojis from GitHub
92508
+ function getNotoFilename(inputStr) {
92509
+ // Clean up whitespace
92510
+ var input = inputStr.trim();
92511
+ if (!input) return 'emoji_u.svg';
92512
+
92513
+ // Regex check: If it contains letters/numbers and starts with U+, contains hex prefixes,
92514
+ // or is separated by underscores/hyphens/spaces, treat it as a code string.
92515
+ var isCodeRegex = /^[0-9a-fA-F_\-\sU\+]+$/;
92516
+ var points = [];
92517
+
92518
+ if (isCodeRegex.test(input) && input.replace(/[_\-\sU\+]/g, '').length > 0) {
92519
+ // --- PROCESS AS ALPHANUMERIC CODE ---
92520
+ // Split by common delimiters: spaces, underscores, hyphens, or "U+"
92521
+ var rawSegments = input.split(/[_\-\s]+/);
92522
+
92523
+ for (var s = 0; s < rawSegments.length; s++) {
92524
+ var segment = rawSegments[s].replace(/^U\+/i, '').toLowerCase();
92525
+ if (segment && segment !== 'fe0f') {
92526
+ points.push(segment);
92527
+ }
92528
+ }
92529
+ } else {
92530
+ // --- PROCESS AS RAW EMOJI PICTURE (Legacy ES5 Surrogate Math) ---
92531
+ var i = 0;
92532
+ while (i < input.length) {
92533
+ var code = input.charCodeAt(i);
92534
+
92535
+ // Handle High/Low Surrogate pairs for 32-bit emojis
92536
+ if (code >= 0xD800 && code <= 0xDBFF && i + 1 < input.length) {
92537
+ var nextCode = input.charCodeAt(i + 1);
92538
+ if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) {
92539
+ code = ((code - 0xD800) * 0x400) + (nextCode - 0xDC00) + 0x10000;
92540
+ i++;
92541
+ }
92542
+ }
92543
+
92544
+ var hex = code.toString(16).toLowerCase();
92545
+ if (hex !== 'fe0f') {
92546
+ points.push(hex);
92547
+ }
92548
+ i++;
92549
+ }
92550
+ }
92551
+
92552
+ // Join all collected hex values with underscores per Google's standard layout
92553
+ return 'emoji_u' + points.join('_') + '.svg';
92554
+ }
92555
+ this.getNotoFilename = getNotoFilename;
92556
+
92435
92557
  function setVisible() {
92436
92558
  if (scaling == "fill") {
92437
92559
  var beside = (zum(that.canvas.style.width) - zim.windowWidth()) / 2;
@@ -92551,6 +92673,14 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
92551
92673
  // // continue;
92552
92674
  // // }
92553
92675
  // }
92676
+
92677
+
92678
+
92679
+ var match;
92680
+ if (a.match) match = a.match(/^noto_(.*)/);
92681
+ if (match) {
92682
+ a = {id:a, src:"https://raw.githubusercontent.com/googlefonts/noto-emoji/main/svg/" + getNotoFilename(match[1])}
92683
+ }
92554
92684
  if (a.replace) a = a.replace(/gf_/i, "https://fonts.googleapis.com/css?family=");
92555
92685
  // split multi into individual ZIM asset objects and make the first of these
92556
92686
  if (a.assets) {
@@ -92559,6 +92689,11 @@ zim.Frame = function(scaling, width, height, color, outerColor, ready, assets, p
92559
92689
  if (!Array.isArray(a.assets)) a.assets = [a.assets];
92560
92690
  for (j=0; j<a.assets.length; j++) {
92561
92691
  var aj = a.assets[j];
92692
+ match = null;
92693
+ if (aj.match) match = aj.match(/^noto_(.*)/);
92694
+ if (match) {
92695
+ aj = {id:aj, src:"https://raw.githubusercontent.com/googlefonts/noto-emoji/main/svg/" + getNotoFilename(match[1])}
92696
+ }
92562
92697
  if (aj.split) {
92563
92698
  var temp = aj.split("?");
92564
92699
  ext = temp[0].match(re);
@@ -95196,7 +95331,7 @@ zim.Dat = function(file) {
95196
95331
  zim.extend(zim.Dat, createjs.EventDispatcher, null, "cjsEventDispatcher", false);//-83.08
95197
95332
 
95198
95333
  /*--
95199
- SVG = function(svg, width, height, bitmap, splitTypes, geometric, showControls, interactive, style, group, inherit)
95334
+ SVG = function(svg, width, height, bitmap, splitTypes, geometric, showControls, interactive, color, borderColor, style, group, inherit)
95200
95335
 
95201
95336
  SVG
95202
95337
  zim class - extends a zim.Container which extends a createjs.Container
@@ -95314,10 +95449,16 @@ PARAMETERS
95314
95449
  Pick Literal formats: [1,3,2] - random; {min:10, max:20} - range; series(1,2,3) - order, function(){return result;} - function
95315
95450
  ** supports OCT - parameter defaults can be set with STYLE control (like CSS)
95316
95451
  svg - |ZIM VEE| the String file name of the SVG including file extension for instance, "pic.svg"
95317
- or an SVG tag either directly as a string or as a reference to an HTML tag - ie. zid("svgID")
95318
- There is a global PATH constant that can be set to add a path to the start of the file name
95319
- for instance setting PATH = "assets/" would then look for "assets/pic.svg".
95320
- If a path is provided to Frame() parameter or the loadAssets() then these will automatically set the global PATH constant.
95452
+ or an SVG tag either directly as a string or as a reference to an HTML tag - ie. zid("svgID")
95453
+ There is a global PATH constant that can be set to add a path to the start of the file name
95454
+ for instance setting PATH = "assets/" would then look for "assets/pic.svg".
95455
+ If a path is provided to Frame() parameter or the loadAssets() then these will automatically set the global PATH constant.
95456
+ NOTE: as of ZIM 020, Noto Color Emojis can be loaded with "noto_emoji"
95457
+ These look consistent across platforms (Windows, Linux, Android, iOS)
95458
+ Paste any emoji character or code after noto_
95459
+ Can also preload the SVG using the noto_ if SVG is to be used in Tile() for instance
95460
+ If color or borderColor is specified then an SVG Container will be nade with individual parts
95461
+ that can be colored, dragged, wiggled, or animated
95321
95462
  width - (default null) optionally predict the width of the SVG
95322
95463
  The width will be ignored and the actual width will be used if the SVG is preloaded
95323
95464
  and if lazy-loaded, the width will be replaced with the actual width after the SVG is loaded.
@@ -95333,7 +95474,10 @@ bitmap - (default true) this will show the SVG as a Bitmap (still nicely scalabl
95333
95474
  splitTypes - (default false) - set to true to split different types of paths into separate objects
95334
95475
  geometric - (default true) - set to false to load Rectangle and Circle objects as Blob objects
95335
95476
  showControls - (default true) set to false to start with controls not showing
95336
- interactive - (default true) set to false to turn off controls, move, toggle, select, edit - leaving just the shapes
95477
+ interactive - (default true) for bitmap:false, set to false to turn off controls, move, toggle, select, edit - leaving just the shapes
95478
+ color - |ZIM VEE| (default null) for bitmap:false, set to a color or an array of colors to apply to fill of children - in order of the children
95479
+ usually a series() would be used here for colors in order, or an array for random colors
95480
+ borderColor - |ZIM VEE| (default null) set to a color or an array of colors to apply to border of children - in order of the children
95337
95481
  style - (default true) set to false to ignore styles set with the STYLE - will receive original parameter defaults
95338
95482
  group - (default null) set to String (or comma delimited String) so STYLE can set default styles to the group(s) (like a CSS class)
95339
95483
  inherit - (default null) used internally but can receive an {} of styles directly
@@ -95381,8 +95525,8 @@ dispatches a "complete" and a "ready" event (use either one) when the SVG is loa
95381
95525
  See the CreateJS Easel Docs for Container events such as:
95382
95526
  added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmove, pressup, removed, rollout, rollover
95383
95527
  --*///+83.09
95384
- zim.SVG = function(svg, width, height, bitmap, splitTypes, geometric, showControls, interactive, style, group, inherit) {
95385
- var sig = "svg, width, height, bitmap, splitTypes, geometric, showControls, interactive, style, group, inherit";
95528
+ zim.SVG = function(svg, width, height, bitmap, splitTypes, geometric, showControls, interactive, color, borderColor, style, group, inherit) {
95529
+ var sig = "svg, width, height, bitmap, splitTypes, geometric, showControls, interactive, color, borderColor, style, group, inherit";
95386
95530
  var duo; if (duo = zob(zim.SVG, arguments, sig, this)) return duo;
95387
95531
  z_d("83.09");
95388
95532
 
@@ -95396,6 +95540,11 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
95396
95540
  if (zot(geometric)) geometric = DS.geometric!=null?DS.geometric:true;
95397
95541
  if (zot(showControls)) showControls = DS.showControls!=null?DS.showControls:null;
95398
95542
  if (zot(interactive)) interactive = DS.interactive!=null?DS.interactive:true;
95543
+ if (zot(color)) color = DS.color!=null?DS.color:null;
95544
+ if (zot(borderColor)) borderColor = DS.borderColor!=null?DS.borderColor:null;
95545
+
95546
+ var setColors = [];
95547
+ var setBorderColors = [];
95399
95548
 
95400
95549
  this.zimContainer_constructor(width, height);
95401
95550
  var that = this;
@@ -95474,6 +95623,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
95474
95623
  if (that.stage) that.stage.update();
95475
95624
  }
95476
95625
  setTimeout(function () {
95626
+ doColors();
95477
95627
  that.dispatchEvent("ready");
95478
95628
  that.dispatchEvent("complete");
95479
95629
  },20);
@@ -95482,6 +95632,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
95482
95632
  that.bitmap = bitmap;
95483
95633
  that.bitmap.addTo(that);
95484
95634
  applyCommands();
95635
+ doColors();
95485
95636
  that.dispatchEvent("ready");
95486
95637
  that.dispatchEvent("complete");
95487
95638
  if (that.stage) that.stage.update();
@@ -95494,11 +95645,12 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
95494
95645
  svgContainer.loop(function (obj) {
95495
95646
  if (obj) obj.addTo(that);
95496
95647
  }, true);
95648
+ doColors();
95497
95649
  if (second) {
95498
95650
  applyCommands();
95499
95651
  if (that.stage) that.stage.update();
95500
95652
  }
95501
- setTimeout(function () {
95653
+ setTimeout(function () {
95502
95654
  that.dispatchEvent("ready");
95503
95655
  that.dispatchEvent("complete");
95504
95656
  },20);
@@ -95510,6 +95662,7 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
95510
95662
  if (obj) obj.addTo(that);
95511
95663
  }, true);
95512
95664
  applyCommands();
95665
+ doColors();
95513
95666
  that.dispatchEvent("ready");
95514
95667
  that.dispatchEvent("complete");
95515
95668
  if (that.stage) that.stage.update();
@@ -95517,6 +95670,25 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
95517
95670
  }
95518
95671
  }
95519
95672
  }
95673
+
95674
+ function doColors() {
95675
+ if (color) {
95676
+ if (color.index) color.index = 0; // not sure where it was setting to 1 when being cloned?
95677
+ that.loop(function(obj) {
95678
+ var c = zik(color);
95679
+ if (c!=null) obj.color = c;
95680
+ setColors.push(c);
95681
+ });
95682
+ }
95683
+ if (borderColor) {
95684
+ if (borderColor.index) borderColor.index = 0;
95685
+ that.loop(function(obj) {
95686
+ var c = zik(borderColor);
95687
+ if (c!=null) obj.borderColor = c;
95688
+ setBorderColors.push(c);
95689
+ });
95690
+ }
95691
+ }
95520
95692
 
95521
95693
  function applyCommands() {
95522
95694
  if (zot(width) && zot(height)) that.setBounds(null); // resets size
@@ -95538,8 +95710,8 @@ added, click, dblclick, mousedown, mouseout, mouseover, pressdown (ZIM), pressmo
95538
95710
  }
95539
95711
 
95540
95712
  if (style!==false) zim.styleTransforms(this, DS);
95541
- that.clone = function (exact) {
95542
- return this.cloneProps(new zim.SVG(exact?svgO:originalSVG, width, height, bitmap, splitTypes, geometric, showControls, interactive, style, this.group, inherit));
95713
+ that.clone = function (exact) {
95714
+ return this.cloneProps(new zim.SVG(exact?svgO:originalSVG, width, height, bitmap, splitTypes, geometric, showControls, interactive, exact&&setColors.length>0?zim.series(setColors):color, exact&&setBoarderColors.length>0?zim.series(setBorderColors):borderColor, style, this.group, inherit));
95543
95715
  }
95544
95716
  }
95545
95717
  zim.extend(zim.SVG, zim.Container, ["clone"], "zimContainer", false);//-83.09
@@ -104349,6 +104521,7 @@ zim class - extends zim.Graph which extends a zim.Container which extends a crea
104349
104521
 
104350
104522
  DESCRIPTION
104351
104523
  Creates a live/animated line graph that updates data over time using a WebWorker.
104524
+ Data is read in from a text file source specified in the src parameter.
104352
104525
  Displays multiple data series as lines with optional gradient fills and smooth curves.
104353
104526
  Automatically manages maxData limit, supports real-time data streaming and animation.
104354
104527
 
@@ -104378,6 +104551,7 @@ const graph = new LiveGraph({
104378
104551
  {item: "CPU", icon: null},
104379
104552
  {item: "Memory", icon: null},
104380
104553
  ],
104554
+ src: "url_to_live_data.txt", // with [12, 24] for instance changing over time
104381
104555
  timeStep: .5,
104382
104556
  smooth: true,
104383
104557
  thickness: 2,
@@ -104410,6 +104584,8 @@ title - (default null) title label or text displayed at top
104410
104584
  info - (default null) info object with labelH, labelV, dataH, dataV arrays
104411
104585
  data - (default null) array of data objects with dataH and dataV properties
104412
104586
  src - (default null) external data source URL for updates
104587
+ format [data] for one entry - this gets read over timeStep
104588
+ format [data, data, data] for three entries, etc. match number of items with data items
104413
104589
  timeStep - (default .5) time interval in seconds between data updates
104414
104590
  thickness - (default 2) line thickness in pixels
104415
104591
  smooth - (default true) whether to use smooth curves instead of straight lines
@@ -2227,12 +2227,14 @@ declare namespace zim {
2227
2227
  readonly numWords: number
2228
2228
  }
2229
2229
  export class Emoji extends Container implements zimComponent {
2230
- constructor(config_or_code: string, size?: number, monochrome?: boolean, italic?: boolean, backgroundColor?: color, backgroundBorderColor?: color, backgroundBorderWidth?: number, corner?: number | any[], backing?: DisplayObject, padding?: number, paddingH?: number, paddingV?: number, shiftH?: number, shiftV?: number, style?: boolean, group?: string, inherit?: {})
2231
- constructor(config: { code: string, size?: number, monochrome?: boolean, italic?: boolean, backgroundColor?: color, backgroundBorderColor?: color, backgroundBorderWidth?: number, corner?: number | any[], backing?: DisplayObject, padding?: number, paddingH?: number, paddingV?: number, shiftH?: number, shiftV?: number, style?: boolean, group?: string, inherit?: {} })
2230
+ constructor(config_or_code: string, size?: number, monochrome?: boolean, italic?: boolean, backgroundColor?: color, backgroundBorderColor?: color, backgroundBorderWidth?: number, corner?: number | any[], backing?: DisplayObject, padding?: number, paddingH?: number, paddingV?: number, shiftH?: number, shiftV?: number, color?: color, borderColor?: color, style?: boolean, group?: string, inherit?: {})
2231
+ constructor(config: { code: string, size?: number, monochrome?: boolean, italic?: boolean, backgroundColor?: color, backgroundBorderColor?: color, backgroundBorderWidth?: number, corner?: number | any[], backing?: DisplayObject, padding?: number, paddingH?: number, paddingV?: number, shiftH?: number, shiftV?: number, color?: color, borderColor?: color, style?: boolean, group?: string, inherit?: {} })
2232
2232
  // ZIM Component Interface
2233
2233
  // dispose():boolean // now added to Container, etc.
2234
2234
  enabled: boolean
2235
2235
  // END ZIM Component Interface
2236
+ label: Label
2237
+ svg: SVG
2236
2238
  }
2237
2239
  export class Button extends Container implements zimComponent {
2238
2240
  constructor(config_or_width?: number | string, height?: number | string, label?: string | Label, backgroundColor?: color, rollBackgroundColor?: color, downBackgroundColor?: color, color?: color, rollColor?: color, downColor?: color, borderColor?: color, borderWidth?: number, rollBorderColor?: color, downBorderColor?: color, backing?: DisplayObject, rollBacking?: DisplayObject, downBacking?: DisplayObject, icon?: DisplayObject, rollIcon?: DisplayObject, downIcon?: DisplayObject, corner?: number | any[], dashed?: boolean | number[], shadowColor?: color, shadowBlur?: number, gradient?: number, gloss?: number, align?: string, valign?: string, indent?: number, indentH?: number, indentV?: number, hitPadding?: number, autoPadding?: number, autoPaddingH?: number, autoPaddingV?: number, rollPersist?: boolean, toggle?: string | boolean, toggleBackgroundColor?: color, rollToggleBackgroundColor?: color, downToggleBackgroundColor?: color, toggleColor?: color, rollToggleColor?: color, downToggleColor?: color, toggleBacking?: DisplayObject, rollToggleBacking?: DisplayObject, downToggleBacking?: DisplayObject, toggleIcon?: DisplayObject, rollToggleIcon?: DisplayObject, downToggleIcon?: DisplayObject, toggleEvent?: string, wait?: string, waitTime?: boolean, waitBackgroundColor?: color, rollWaitBackgroundColor?: color, downWaitBackgroundColor?: color, waitColor?: color, rollWaitColor?: color, downWaitColor?: color, waitBacking?: DisplayObject, rollWaitBacking?: DisplayObject, downWaitBacking?: DisplayObject, waitIcon?: DisplayObject, rollWaitIcon?: DisplayObject, downWaitIcon?: DisplayObject, waitModal?: boolean, waitEnabled?: boolean, style?: boolean, group?: string, inherit?: {})
@@ -2743,14 +2745,15 @@ declare namespace zim {
2743
2745
  pad: Pad
2744
2746
  }
2745
2747
  export class DPad extends Container implements zimComponent {
2746
- constructor(config_or_axis?: string, width?: number, backgroundColor?: color, indicatorColor?: color, indicatorPressColor?: color, indicatorScale?: number, indicatorRadius?: number, innerCircle?: boolean, innerScale?: number, activeRadius?: number, clamp?: boolean, logo?: boolean, style?: boolean, group?: string, inherit?: {})
2747
- constructor(config: { axis?: string, width?: number, backgroundColor?: color, indicatorColor?: color, indicatorPressColor?: color, indicatorScale?: number, indicatorRadius?: number, innerCircle?: boolean, innerScale?: number, activeRadius?: number, clamp?: boolean, logo?: boolean, style?: boolean, group?: string, inherit?: {} })
2748
+ constructor(config_or_axis?: string, width?: number, backgroundColor?: color, indicatorColor?: color, indicatorPressColor?: color, indicatorScale?: number, indicatorRadius?: number, innerCircle?: boolean, innerScale?: number, activeRadius?: number, clamp?: boolean, logo?: boolean, useBubble?:boolean, style?: boolean, group?: string, inherit?: {})
2749
+ constructor(config: { axis?: string, width?: number, backgroundColor?: color, indicatorColor?: color, indicatorPressColor?: color, indicatorScale?: number, indicatorRadius?: number, innerCircle?: boolean, innerScale?: number, activeRadius?: number, clamp?: boolean, logo?: boolean, useBubble?:boolean, style?: boolean, group?: string, inherit?: {} })
2748
2750
  // ZIM Component Interface
2749
2751
  // dispose():boolean // now added to Container, etc.
2750
2752
  enabled: boolean
2751
2753
  // END ZIM Component Interface
2752
2754
  readonly dirX: number
2753
2755
  readonly dirY: number
2756
+ readonly bubble: Circle
2754
2757
  }
2755
2758
  export class Radial extends Container implements zimComponent {
2756
2759
  constructor(config_or_labels?: string[] | number[] | Label[], size?: number, font?: string, startAngle?: number, totalAngle?: number, angles?: number[], flip?: boolean, shiftRadial?: number, icons?: DisplayObject[], rollIcons?: DisplayObject[], rotateIcons?: boolean, iconsShiftRadial?: number, height?: number, coreRadius?: number, coreColor?: number, backgroundColor?: color, rollBackgroundColor?: color, selectedBackgroundColor?: color, selectedRollBackgroundColor?: color, backdropColor?: color, color?: color, rollColor?: color, selectedColor?: color, selectedRollColor?: color, borderColor?: color, borderWidth?: number, gradient?: number, gap?: number, gapAsAngle?: boolean, spacing?: number, spacingInner?: number, spacingOuter?: number, currentEnabled?: boolean, currentSelected?: boolean, index?: number, selectedIndex?: number, style?: boolean, group?: string, inherit?: {})
@@ -3,13 +3,12 @@
3
3
  "module": "commonjs",
4
4
  "lib": [
5
5
  "es6",
6
- "dom",
6
+ "dom"
7
7
  ],
8
8
  "noImplicitAny": true,
9
9
  "noImplicitThis": true,
10
10
  "strictNullChecks": true,
11
11
  "strictFunctionTypes": true,
12
- "baseUrl": "../",
13
12
  "typeRoots": [
14
13
  "../"
15
14
  ],