zrender-nightly 5.5.0-dev.20240129 → 5.5.1-dev.20240130

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.
Files changed (61) hide show
  1. package/README.md +1 -1
  2. package/build/package.json +3 -0
  3. package/dist/package.json +3 -0
  4. package/dist/zrender.js +218 -27
  5. package/dist/zrender.js.map +1 -1
  6. package/dist/zrender.min.js +1 -1
  7. package/lib/Element.d.ts +1 -0
  8. package/lib/Element.js +12 -0
  9. package/lib/Handler.js +3 -3
  10. package/lib/canvas/Layer.d.ts +0 -1
  11. package/lib/canvas/Layer.js +2 -2
  12. package/lib/canvas/Painter.js +1 -1
  13. package/lib/core/PathProxy.js +0 -1
  14. package/lib/core/Transformable.js +5 -1
  15. package/lib/core/env.js +2 -1
  16. package/lib/core/matrix.d.ts +1 -1
  17. package/lib/core/matrix.js +4 -3
  18. package/lib/core/timsort.js +0 -9
  19. package/lib/graphic/helper/parseText.d.ts +1 -1
  20. package/lib/svg/Painter.d.ts +2 -0
  21. package/lib/svg/Painter.js +3 -2
  22. package/lib/svg/core.d.ts +3 -1
  23. package/lib/svg/core.js +2 -1
  24. package/lib/svg/cssAnimation.js +2 -1
  25. package/lib/svg/cssClassId.d.ts +1 -0
  26. package/lib/svg/cssClassId.js +4 -0
  27. package/lib/svg/cssEmphasis.d.ts +3 -0
  28. package/lib/svg/cssEmphasis.js +60 -0
  29. package/lib/svg/graphic.js +21 -1
  30. package/lib/svg/patch.js +4 -1
  31. package/lib/tool/color.d.ts +3 -0
  32. package/lib/tool/color.js +21 -0
  33. package/lib/tool/parseSVG.js +4 -1
  34. package/lib/zrender.d.ts +10 -4
  35. package/lib/zrender.js +69 -6
  36. package/package.README.md +9 -0
  37. package/package.json +29 -2
  38. package/src/.eslintrc.yaml +1 -1
  39. package/src/Element.ts +16 -0
  40. package/src/Handler.ts +3 -3
  41. package/src/canvas/Layer.ts +2 -5
  42. package/src/canvas/Painter.ts +2 -2
  43. package/src/core/PathProxy.ts +0 -2
  44. package/src/core/Transformable.ts +6 -1
  45. package/src/core/env.ts +4 -1
  46. package/src/core/matrix.ts +8 -3
  47. package/src/core/timsort.ts +0 -13
  48. package/src/core/util.ts +4 -4
  49. package/src/dom/HandlerProxy.ts +7 -7
  50. package/src/graphic/helper/parseText.ts +4 -4
  51. package/src/svg/Painter.ts +13 -6
  52. package/src/svg/core.ts +10 -2
  53. package/src/svg/cssAnimation.ts +2 -1
  54. package/src/svg/cssClassId.ts +5 -0
  55. package/src/svg/cssEmphasis.ts +73 -0
  56. package/src/svg/graphic.ts +23 -1
  57. package/src/svg/patch.ts +5 -2
  58. package/src/tool/color.ts +27 -1
  59. package/src/tool/parseSVG.ts +4 -1
  60. package/src/zrender.ts +82 -11
  61. package/.travis.yml +0 -12
package/README.md CHANGED
@@ -3,7 +3,7 @@ ZRender
3
3
 
4
4
  A lightweight graphic library which provides 2d draw for [Apache ECharts](https://github.com/apache/echarts).
5
5
 
6
- [![Build Status](https://travis-ci.com/ecomfe/zrender.svg?branch=master)](https://travis-ci.com/ecomfe/zrender) [![](https://img.shields.io/npm/dw/zrender.svg?label=npm%20downloads&style=flat)](https://www.npmjs.com/package/zrender) ![Commits Since 4.0.0](https://img.shields.io/github/commits-since/ecomfe/zrender/4.0.0.svg?colorB=%234c1&style=flat)
6
+ [![](https://img.shields.io/github/actions/workflow/status/ecomfe/zrender/ci.yml)]() [![](https://img.shields.io/npm/dw/zrender.svg?label=npm%20downloads&style=flat)](https://www.npmjs.com/package/zrender) ![Commits Since 4.0.0](https://img.shields.io/github/commits-since/ecomfe/zrender/4.0.0.svg?colorB=%234c1&style=flat)
7
7
 
8
8
  ## Documentation
9
9
 
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "commonjs"
3
+ }
package/dist/zrender.js CHANGED
@@ -38,7 +38,8 @@
38
38
  else if (typeof document === 'undefined' && typeof self !== 'undefined') {
39
39
  env.worker = true;
40
40
  }
41
- else if (typeof navigator === 'undefined') {
41
+ else if (typeof navigator === 'undefined'
42
+ || navigator.userAgent.indexOf('Node.js') === 0) {
42
43
  env.node = true;
43
44
  env.svgSupported = true;
44
45
  }
@@ -1524,7 +1525,8 @@
1524
1525
  out[5] = a[5] + v[1];
1525
1526
  return out;
1526
1527
  }
1527
- function rotate(out, a, rad) {
1528
+ function rotate(out, a, rad, pivot) {
1529
+ if (pivot === void 0) { pivot = [0, 0]; }
1528
1530
  var aa = a[0];
1529
1531
  var ac = a[2];
1530
1532
  var atx = a[4];
@@ -1537,8 +1539,8 @@
1537
1539
  out[1] = -aa * st + ab * ct;
1538
1540
  out[2] = ac * ct + ad * st;
1539
1541
  out[3] = -ac * st + ct * ad;
1540
- out[4] = ct * atx + st * aty;
1541
- out[5] = ct * aty - st * atx;
1542
+ out[4] = ct * (atx - pivot[0]) + st * (aty - pivot[1]) + pivot[0];
1543
+ out[5] = ct * (aty - pivot[1]) - st * (atx - pivot[0]) + pivot[1];
1542
1544
  return out;
1543
1545
  }
1544
1546
  function scale$1(out, a, v) {
@@ -2189,9 +2191,9 @@
2189
2191
  if (clipPath && !clipPath.contain(x, y)) {
2190
2192
  return false;
2191
2193
  }
2192
- if (el.silent) {
2193
- isSilent = true;
2194
- }
2194
+ }
2195
+ if (el.silent) {
2196
+ isSilent = true;
2195
2197
  }
2196
2198
  var hostEl = el.__hostTarget;
2197
2199
  el = hostEl ? hostEl : el.parent;
@@ -2388,11 +2390,9 @@
2388
2390
  }
2389
2391
  function TimSort(array, compare) {
2390
2392
  var minGallop = DEFAULT_MIN_GALLOPING;
2391
- var length = 0;
2392
2393
  var runStart;
2393
2394
  var runLength;
2394
2395
  var stackSize = 0;
2395
- length = array.length;
2396
2396
  var tmp = [];
2397
2397
  runStart = [];
2398
2398
  runLength = [];
@@ -4051,6 +4051,26 @@
4051
4051
  Math.round(Math.random() * 255),
4052
4052
  Math.round(Math.random() * 255)
4053
4053
  ], 'rgb');
4054
+ }
4055
+ var liftedColorCache = new LRU(100);
4056
+ function liftColor(color) {
4057
+ if (isString(color)) {
4058
+ var liftedColor = liftedColorCache.get(color);
4059
+ if (!liftedColor) {
4060
+ liftedColor = lift(color, -0.1);
4061
+ liftedColorCache.put(color, liftedColor);
4062
+ }
4063
+ return liftedColor;
4064
+ }
4065
+ else if (isGradientObject(color)) {
4066
+ var ret = extend({}, color);
4067
+ ret.colorStops = map(color.colorStops, function (stop) { return ({
4068
+ offset: stop.offset,
4069
+ color: lift(stop.color, -0.1)
4070
+ }); });
4071
+ return ret;
4072
+ }
4073
+ return color;
4054
4074
  }
4055
4075
 
4056
4076
  var color = /*#__PURE__*/Object.freeze({
@@ -4066,7 +4086,8 @@
4066
4086
  modifyAlpha: modifyAlpha,
4067
4087
  stringify: stringify,
4068
4088
  lum: lum,
4069
- random: random
4089
+ random: random,
4090
+ liftColor: liftColor
4070
4091
  });
4071
4092
 
4072
4093
  var mathRound = Math.round;
@@ -5425,7 +5446,10 @@
5425
5446
  var needLocalTransform = this.needLocalTransform();
5426
5447
  var m = this.transform;
5427
5448
  if (!(needLocalTransform || parentTransform)) {
5428
- m && mIdentity(m);
5449
+ if (m) {
5450
+ mIdentity(m);
5451
+ this.invTransform = null;
5452
+ }
5429
5453
  return;
5430
5454
  }
5431
5455
  m = m || create$1();
@@ -5501,6 +5525,7 @@
5501
5525
  var parent = this.parent;
5502
5526
  var m = this.transform;
5503
5527
  if (parent && parent.transform) {
5528
+ parent.invTransform = parent.invTransform || create$1();
5504
5529
  mul$1(tmpTransform, parent.invTransform, m);
5505
5530
  m = tmpTransform;
5506
5531
  }
@@ -6175,6 +6200,18 @@
6175
6200
  }
6176
6201
  }
6177
6202
  };
6203
+ Element.prototype.isSilent = function () {
6204
+ var isSilent = this.silent;
6205
+ var ancestor = this.parent;
6206
+ while (!isSilent && ancestor) {
6207
+ if (ancestor.silent) {
6208
+ isSilent = true;
6209
+ break;
6210
+ }
6211
+ ancestor = ancestor.parent;
6212
+ }
6213
+ return isSilent;
6214
+ };
6178
6215
  Element.prototype._updateAnimationTargets = function () {
6179
6216
  for (var i = 0; i < this.animators.length; i++) {
6180
6217
  var animator = this.animators[i];
@@ -7045,7 +7082,7 @@
7045
7082
  var ssrMode = opts.ssr || painter.ssrOnly;
7046
7083
  this.storage = storage;
7047
7084
  this.painter = painter;
7048
- var handerProxy = (!env.node && !env.worker && !ssrMode)
7085
+ var handlerProxy = (!env.node && !env.worker && !ssrMode)
7049
7086
  ? new HandlerDomProxy(painter.getViewportRoot(), painter.root)
7050
7087
  : null;
7051
7088
  var useCoarsePointer = opts.useCoarsePointer;
@@ -7057,7 +7094,7 @@
7057
7094
  if (usePointerSize) {
7058
7095
  pointerSize = retrieve2(opts.pointerSize, defaultPointerSize);
7059
7096
  }
7060
- this.handler = new Handler(storage, painter, handerProxy, painter.root, pointerSize);
7097
+ this.handler = new Handler(storage, painter, handlerProxy, painter.root, pointerSize);
7061
7098
  this.animation = new Animation({
7062
7099
  stage: {
7063
7100
  update: ssrMode ? null : function () { return _this._flush(true); }
@@ -7068,7 +7105,7 @@
7068
7105
  }
7069
7106
  }
7070
7107
  ZRender.prototype.add = function (el) {
7071
- if (!el) {
7108
+ if (this._disposed || !el) {
7072
7109
  return;
7073
7110
  }
7074
7111
  this.storage.addRoot(el);
@@ -7076,7 +7113,7 @@
7076
7113
  this.refresh();
7077
7114
  };
7078
7115
  ZRender.prototype.remove = function (el) {
7079
- if (!el) {
7116
+ if (this._disposed || !el) {
7080
7117
  return;
7081
7118
  }
7082
7119
  this.storage.delRoot(el);
@@ -7084,12 +7121,18 @@
7084
7121
  this.refresh();
7085
7122
  };
7086
7123
  ZRender.prototype.configLayer = function (zLevel, config) {
7124
+ if (this._disposed) {
7125
+ return;
7126
+ }
7087
7127
  if (this.painter.configLayer) {
7088
7128
  this.painter.configLayer(zLevel, config);
7089
7129
  }
7090
7130
  this.refresh();
7091
7131
  };
7092
7132
  ZRender.prototype.setBackgroundColor = function (backgroundColor) {
7133
+ if (this._disposed) {
7134
+ return;
7135
+ }
7093
7136
  if (this.painter.setBackgroundColor) {
7094
7137
  this.painter.setBackgroundColor(backgroundColor);
7095
7138
  }
@@ -7107,6 +7150,9 @@
7107
7150
  return this._darkMode;
7108
7151
  };
7109
7152
  ZRender.prototype.refreshImmediately = function (fromInside) {
7153
+ if (this._disposed) {
7154
+ return;
7155
+ }
7110
7156
  if (!fromInside) {
7111
7157
  this.animation.update(true);
7112
7158
  }
@@ -7115,10 +7161,16 @@
7115
7161
  this._needsRefresh = false;
7116
7162
  };
7117
7163
  ZRender.prototype.refresh = function () {
7164
+ if (this._disposed) {
7165
+ return;
7166
+ }
7118
7167
  this._needsRefresh = true;
7119
7168
  this.animation.start();
7120
7169
  };
7121
7170
  ZRender.prototype.flush = function () {
7171
+ if (this._disposed) {
7172
+ return;
7173
+ }
7122
7174
  this._flush(false);
7123
7175
  };
7124
7176
  ZRender.prototype._flush = function (fromInside) {
@@ -7150,6 +7202,9 @@
7150
7202
  this._sleepAfterStill = stillFramesCount;
7151
7203
  };
7152
7204
  ZRender.prototype.wakeUp = function () {
7205
+ if (this._disposed) {
7206
+ return;
7207
+ }
7153
7208
  this.animation.start();
7154
7209
  this._stillFrameAccum = 0;
7155
7210
  };
@@ -7157,42 +7212,74 @@
7157
7212
  this._needsRefreshHover = true;
7158
7213
  };
7159
7214
  ZRender.prototype.refreshHoverImmediately = function () {
7215
+ if (this._disposed) {
7216
+ return;
7217
+ }
7160
7218
  this._needsRefreshHover = false;
7161
7219
  if (this.painter.refreshHover && this.painter.getType() === 'canvas') {
7162
7220
  this.painter.refreshHover();
7163
7221
  }
7164
7222
  };
7165
7223
  ZRender.prototype.resize = function (opts) {
7224
+ if (this._disposed) {
7225
+ return;
7226
+ }
7166
7227
  opts = opts || {};
7167
7228
  this.painter.resize(opts.width, opts.height);
7168
7229
  this.handler.resize();
7169
7230
  };
7170
7231
  ZRender.prototype.clearAnimation = function () {
7232
+ if (this._disposed) {
7233
+ return;
7234
+ }
7171
7235
  this.animation.clear();
7172
7236
  };
7173
7237
  ZRender.prototype.getWidth = function () {
7238
+ if (this._disposed) {
7239
+ return;
7240
+ }
7174
7241
  return this.painter.getWidth();
7175
7242
  };
7176
7243
  ZRender.prototype.getHeight = function () {
7244
+ if (this._disposed) {
7245
+ return;
7246
+ }
7177
7247
  return this.painter.getHeight();
7178
7248
  };
7179
7249
  ZRender.prototype.setCursorStyle = function (cursorStyle) {
7250
+ if (this._disposed) {
7251
+ return;
7252
+ }
7180
7253
  this.handler.setCursorStyle(cursorStyle);
7181
7254
  };
7182
7255
  ZRender.prototype.findHover = function (x, y) {
7256
+ if (this._disposed) {
7257
+ return;
7258
+ }
7183
7259
  return this.handler.findHover(x, y);
7184
7260
  };
7185
7261
  ZRender.prototype.on = function (eventName, eventHandler, context) {
7186
- this.handler.on(eventName, eventHandler, context);
7262
+ if (!this._disposed) {
7263
+ this.handler.on(eventName, eventHandler, context);
7264
+ }
7187
7265
  return this;
7188
7266
  };
7189
7267
  ZRender.prototype.off = function (eventName, eventHandler) {
7268
+ if (this._disposed) {
7269
+ return;
7270
+ }
7190
7271
  this.handler.off(eventName, eventHandler);
7191
7272
  };
7192
7273
  ZRender.prototype.trigger = function (eventName, event) {
7274
+ if (this._disposed) {
7275
+ return;
7276
+ }
7193
7277
  this.handler.trigger(eventName, event);
7194
7278
  };
7195
7279
  ZRender.prototype.clear = function () {
7280
+ if (this._disposed) {
7281
+ return;
7282
+ }
7196
7283
  var roots = this.storage.getRoots();
7197
7284
  for (var i = 0; i < roots.length; i++) {
7198
7285
  if (roots[i] instanceof Group) {
@@ -7203,6 +7290,9 @@
7203
7290
  this.painter.clear();
7204
7291
  };
7205
7292
  ZRender.prototype.dispose = function () {
7293
+ if (this._disposed) {
7294
+ return;
7295
+ }
7206
7296
  this.animation.stop();
7207
7297
  this.clear();
7208
7298
  this.storage.dispose();
@@ -7212,6 +7302,7 @@
7212
7302
  this.storage =
7213
7303
  this.painter =
7214
7304
  this.handler = null;
7305
+ this._disposed = true;
7215
7306
  delInstance(this.id);
7216
7307
  };
7217
7308
  return ZRender;
@@ -7238,7 +7329,16 @@
7238
7329
  function registerPainter(name, Ctor) {
7239
7330
  painterCtors[name] = Ctor;
7240
7331
  }
7241
- var version = '5.5.0-dev.20240129';
7332
+ var ssrDataGetter;
7333
+ function getElementSSRData(el) {
7334
+ if (typeof ssrDataGetter === 'function') {
7335
+ return ssrDataGetter(el);
7336
+ }
7337
+ }
7338
+ function registerSSRDataGetter(getter) {
7339
+ ssrDataGetter = getter;
7340
+ }
7341
+ var version = '5.5.1-dev.20240130';
7242
7342
 
7243
7343
  var STYLE_MAGIC_KEY = '__zr_style_' + Math.round((Math.random() * 10));
7244
7344
  var DEFAULT_COMMON_STYLE = {
@@ -8113,7 +8213,6 @@
8113
8213
  var delta = data[i++];
8114
8214
  var endAngle = delta + startAngle;
8115
8215
  i += 1;
8116
- var anticlockwise = !data[i++];
8117
8216
  if (isFirst) {
8118
8217
  x0 = mathCos$1(startAngle) * rx + cx;
8119
8218
  y0 = mathSin$1(startAngle) * ry + cy;
@@ -10807,7 +10906,10 @@
10807
10906
  scale$1(mt, mt, [parseFloat(valueArr[0]), parseFloat(valueArr[1] || valueArr[0])]);
10808
10907
  break;
10809
10908
  case 'rotate':
10810
- rotate(mt, mt, -parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);
10909
+ rotate(mt, mt, -parseFloat(valueArr[0]) * DEGREE_TO_ANGLE, [
10910
+ parseFloat(valueArr[1] || '0'),
10911
+ parseFloat(valueArr[2] || '0')
10912
+ ]);
10811
10913
  break;
10812
10914
  case 'skewX':
10813
10915
  var sx = Math.tan(parseFloat(valueArr[0]) * DEGREE_TO_ANGLE);
@@ -14927,7 +15029,7 @@
14927
15029
  }
14928
15030
  for (var i = this.__prevStartIndex; i < this.__prevEndIndex; ++i) {
14929
15031
  var el = prevList[i];
14930
- var shouldPaint = el.shouldBePainted(viewWidth, viewHeight, true, true);
15032
+ var shouldPaint = el && el.shouldBePainted(viewWidth, viewHeight, true, true);
14931
15033
  if (el && (!shouldPaint || !el.__zr) && el.__isRendered) {
14932
15034
  var prevRect = el.getPrevPaintRect();
14933
15035
  if (prevRect) {
@@ -15024,7 +15126,7 @@
15024
15126
  clearColorGradientOrPattern = createCanvasPattern(ctx, clearColor, {
15025
15127
  dirty: function () {
15026
15128
  self.setUnpainted();
15027
- self.__painter.refresh();
15129
+ self.painter.refresh();
15028
15130
  }
15029
15131
  });
15030
15132
  }
@@ -15439,7 +15541,7 @@
15439
15541
  }
15440
15542
  }
15441
15543
  }
15442
- layer.__painter = this;
15544
+ layer.painter || (layer.painter = this);
15443
15545
  };
15444
15546
  CanvasPainter.prototype.eachLayer = function (cb, context) {
15445
15547
  var zlevelList = this._zlevelList;
@@ -15867,6 +15969,7 @@
15867
15969
  var XLINKNS = 'http://www.w3.org/1999/xlink';
15868
15970
  var XMLNS = 'http://www.w3.org/2000/xmlns/';
15869
15971
  var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
15972
+ var META_DATA_PREFIX = 'ecmeta_';
15870
15973
  function createElement(name) {
15871
15974
  return document.createElementNS(SVGNS, name);
15872
15975
  }
@@ -15947,7 +16050,7 @@
15947
16050
  defs: {},
15948
16051
  cssNodes: {},
15949
16052
  cssAnims: {},
15950
- cssClassIdx: 0,
16053
+ cssStyleCache: {},
15951
16054
  cssAnimIdx: 0,
15952
16055
  shadowIdx: 0,
15953
16056
  gradientIdx: 0,
@@ -15967,6 +16070,11 @@
15967
16070
  }, children);
15968
16071
  }
15969
16072
 
16073
+ var cssClassIdx = 0;
16074
+ function getClassId() {
16075
+ return cssClassIdx++;
16076
+ }
16077
+
15970
16078
  var EASING_MAP = {
15971
16079
  cubicIn: '0.32,0,0.67,0',
15972
16080
  cubicOut: '0.33,1,0.68,1',
@@ -16225,7 +16333,7 @@
16225
16333
  }
16226
16334
  }
16227
16335
  if (cssAnimations.length) {
16228
- var className = scope.zrId + '-cls-' + scope.cssClassIdx++;
16336
+ var className = scope.zrId + '-cls-' + getClassId();
16229
16337
  scope.cssNodes['.' + className] = {
16230
16338
  animation: cssAnimations.join(',')
16231
16339
  };
@@ -16233,6 +16341,65 @@
16233
16341
  }
16234
16342
  }
16235
16343
 
16344
+ function createCSSEmphasis(el, attrs, scope) {
16345
+ if (!el.ignore) {
16346
+ if (el.isSilent()) {
16347
+ var style = {
16348
+ 'pointer-events': 'none'
16349
+ };
16350
+ setClassAttribute(style, attrs, scope, true);
16351
+ }
16352
+ else {
16353
+ var emphasisStyle = el.states.emphasis && el.states.emphasis.style
16354
+ ? el.states.emphasis.style
16355
+ : {};
16356
+ var fill = emphasisStyle.fill;
16357
+ if (!fill) {
16358
+ var normalFill = el.style && el.style.fill;
16359
+ var selectFill = el.states.select
16360
+ && el.states.select.style
16361
+ && el.states.select.style.fill;
16362
+ var fromFill = el.currentStates.indexOf('select') >= 0
16363
+ ? (selectFill || normalFill)
16364
+ : normalFill;
16365
+ if (fromFill) {
16366
+ fill = liftColor(fromFill);
16367
+ }
16368
+ }
16369
+ var lineWidth = emphasisStyle.lineWidth;
16370
+ if (lineWidth) {
16371
+ var scaleX = (!emphasisStyle.strokeNoScale && el.transform)
16372
+ ? el.transform[0]
16373
+ : 1;
16374
+ lineWidth = lineWidth / scaleX;
16375
+ }
16376
+ var style = {
16377
+ cursor: 'pointer',
16378
+ };
16379
+ if (fill) {
16380
+ style.fill = fill;
16381
+ }
16382
+ if (emphasisStyle.stroke) {
16383
+ style.stroke = emphasisStyle.stroke;
16384
+ }
16385
+ if (lineWidth) {
16386
+ style['stroke-width'] = lineWidth;
16387
+ }
16388
+ setClassAttribute(style, attrs, scope, true);
16389
+ }
16390
+ }
16391
+ }
16392
+ function setClassAttribute(style, attrs, scope, withHover) {
16393
+ var styleKey = JSON.stringify(style);
16394
+ var className = scope.cssStyleCache[styleKey];
16395
+ if (!className) {
16396
+ className = scope.zrId + '-cls-' + getClassId();
16397
+ scope.cssStyleCache[styleKey] = className;
16398
+ scope.cssNodes['.' + className + (withHover ? ':hover' : '')] = style;
16399
+ }
16400
+ attrs["class"] = attrs["class"] ? (attrs["class"] + ' ' + className) : className;
16401
+ }
16402
+
16236
16403
  var round$1 = Math.round;
16237
16404
  function isImageLike$1(val) {
16238
16405
  return val && isString(val.src);
@@ -16249,12 +16416,26 @@
16249
16416
  else if (isFillStroke && isPattern(val)) {
16250
16417
  setPattern(el, attrs, key, scope);
16251
16418
  }
16419
+ else if (isFillStroke && val === 'none') {
16420
+ attrs[key] = 'transparent';
16421
+ }
16252
16422
  else {
16253
16423
  attrs[key] = val;
16254
16424
  }
16255
16425
  }, style, el, false);
16256
16426
  setShadow(el, attrs, scope);
16257
16427
  }
16428
+ function setMetaData(attrs, el) {
16429
+ var metaData = getElementSSRData(el);
16430
+ if (metaData) {
16431
+ metaData.each(function (val, key) {
16432
+ val != null && (attrs[(META_DATA_PREFIX + key).toLowerCase()] = val + '');
16433
+ });
16434
+ if (el.isSilent()) {
16435
+ attrs[META_DATA_PREFIX + 'silent'] = 'true';
16436
+ }
16437
+ }
16438
+ }
16258
16439
  function noRotateScale(m) {
16259
16440
  return isAroundZero$1(m[0] - 1)
16260
16441
  && isAroundZero$1(m[1])
@@ -16359,7 +16540,9 @@
16359
16540
  }
16360
16541
  setTransform(attrs, el.transform);
16361
16542
  setStyleAttrs(attrs, style, el, scope);
16543
+ setMetaData(attrs, el);
16362
16544
  scope.animation && createCSSAnimation(el, attrs, scope);
16545
+ scope.emphasis && createCSSEmphasis(el, attrs, scope);
16363
16546
  return createVNode(svgElType, el.id + '', attrs);
16364
16547
  }
16365
16548
  function brushSVGImage(el, scope) {
@@ -16393,6 +16576,7 @@
16393
16576
  }
16394
16577
  setTransform(attrs, el.transform);
16395
16578
  setStyleAttrs(attrs, style, el, scope);
16579
+ setMetaData(attrs, el);
16396
16580
  scope.animation && createCSSAnimation(el, attrs, scope);
16397
16581
  return createVNode('image', el.id + '', attrs);
16398
16582
  }
@@ -16444,6 +16628,7 @@
16444
16628
  }
16445
16629
  setTransform(attrs, el.transform);
16446
16630
  setStyleAttrs(attrs, style, el, scope);
16631
+ setMetaData(attrs, el);
16447
16632
  scope.animation && createCSSAnimation(el, attrs, scope);
16448
16633
  return createVNode('text', el.id + '', attrs, undefined, text);
16449
16634
  }
@@ -16796,7 +16981,10 @@
16796
16981
  elm.removeAttribute(key);
16797
16982
  }
16798
16983
  else {
16799
- if (key.charCodeAt(0) !== xChar) {
16984
+ if (key === 'style') {
16985
+ elm.style.cssText = cur;
16986
+ }
16987
+ else if (key.charCodeAt(0) !== xChar) {
16800
16988
  elm.setAttribute(key, cur);
16801
16989
  }
16802
16990
  else if (key === 'xmlns:xlink' || key === 'xmlns') {
@@ -17011,6 +17199,7 @@
17011
17199
  scope.animation = opts.animation;
17012
17200
  scope.willUpdate = opts.willUpdate;
17013
17201
  scope.compress = opts.compress;
17202
+ scope.emphasis = opts.emphasis;
17014
17203
  var children = [];
17015
17204
  var bgVNode = this._bgVNode = createBackgroundVNode(width, height, this._backgroundColor, scope);
17016
17205
  bgVNode && children.push(bgVNode);
@@ -17035,6 +17224,7 @@
17035
17224
  opts = opts || {};
17036
17225
  return vNodeToString(this.renderToVNode({
17037
17226
  animation: retrieve2(opts.cssAnimation, true),
17227
+ emphasis: retrieve2(opts.cssEmphasis, true),
17038
17228
  willUpdate: false,
17039
17229
  compress: true,
17040
17230
  useViewBox: retrieve2(opts.useViewBox, true)
@@ -17171,8 +17361,7 @@
17171
17361
  width: width,
17172
17362
  height: height,
17173
17363
  x: '0',
17174
- y: '0',
17175
- id: '0'
17364
+ y: '0'
17176
17365
  });
17177
17366
  if (isGradient(backgroundColor)) {
17178
17367
  setGradient({ fill: backgroundColor }, bgVNode.attrs, 'fill', scope);
@@ -17248,6 +17437,7 @@
17248
17437
  exports.color = color;
17249
17438
  exports.dispose = dispose;
17250
17439
  exports.disposeAll = disposeAll;
17440
+ exports.getElementSSRData = getElementSSRData;
17251
17441
  exports.getInstance = getInstance;
17252
17442
  exports.init = init;
17253
17443
  exports.matrix = matrix;
@@ -17255,6 +17445,7 @@
17255
17445
  exports.parseSVG = parseSVG;
17256
17446
  exports.path = path;
17257
17447
  exports.registerPainter = registerPainter;
17448
+ exports.registerSSRDataGetter = registerSSRDataGetter;
17258
17449
  exports.setPlatformAPI = setPlatformAPI;
17259
17450
  exports.showDebugDirtyRect = showDebugDirtyRect;
17260
17451
  exports.util = util;