@xiee/utils 1.14.30 → 1.14.31

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/js/g2-patches.js CHANGED
@@ -21,7 +21,7 @@ G2.register("data.column", (options) => {
21
21
  (() => {
22
22
  const FONT_SCALE = 4 / 3,
23
23
  FONT_RE = /[fF]ontSize$/,
24
- POINT_RADIUS = 5;
24
+ POINT_RADIUS = 4;
25
25
 
26
26
  const isObj = (v) => v && typeof v === "object" && !Array.isArray(v);
27
27
 
@@ -1,2 +1,2 @@
1
- G2.register("data.column",e=>{const{value:t}=e;return async()=>{let e=t;if("string"==typeof t){const o=await fetch(t);e=await o.json()}const o=Object.keys(e);return 0===o.length?[]:e[o[0]].map((t,r)=>o.reduce((t,o)=>(t[o]=e[o][r],t),{}))}}),(()=>{const e=4/3,t=/[fF]ontSize$/,o=e=>e&&"object"==typeof e&&!Array.isArray(e),r=n=>{if(o(n))for(const[s,c]of Object.entries(n))o(c)?r(c):"number"==typeof c&&t.test(s)&&(n[s]=c*e)},n=t=>{if(r(t),o(t.legendCategory)&&"number"==typeof t.legendCategory.itemMarkerSize&&(t.legendCategory.itemMarkerSize*=e),o(t.point))for(const e of Object.values(t.point))o(e)&&"number"==typeof e.r&&(e.r=5);return o(t.axis)&&(t.axis.gridStrokeOpacity=.25),t.inset=16,t};for(const e of["Light","Dark","Classic","ClassicDark","Academy"]){const t=G2[e];if("function"!=typeof t)continue;let o;G2[e]=(...e)=>o??=n(t(...e));const r="theme."+e[0].toLowerCase()+e.slice(1);try{G2.register(r,G2[e])}catch(e){}}const s=()=>(e,t)=>{if(void 0!==t.encode.size)return[e,t];const o=[];for(const t of e)o[t]=5;return[e,{...t,encode:{...t.encode,size:{type:"column",value:o,visual:!0}}}]};s.props={};const c=G2.corelib();for(const e of["mark.point","mark.beeswarm"])for(const[t,o]of(c[e]?.props?.postInference??[]).entries())o.type===G2.MaybeSize&&(c[e].props.postInference[t]={type:s});for(const e of["mark.point","mark.beeswarm"]){const t=c[e];if(!t?.props?.shape)continue;t.props.defaultShape="point";const o=Object.fromEntries(Object.entries(t.props.shape).sort(([e],[t])=>/^hollow/.test(e)-/^hollow/.test(t)));t.props.shape=o;for(const e of t.props.channels||[])"shape"===e.name&&(e.range=Object.keys(o))}const a=G2.graphlib?.()??{};for(const t of["mark.sankey","mark.chord","mark.treemap"]){const o=a[t];if("function"!=typeof o)continue;const r=function(...t){const r=o.apply(this,t);for(const t of Array.isArray(r)?r:[r])if(Array.isArray(t?.labels))for(const o of t.labels)"number"==typeof o?.fontSize&&(o.fontSize*=e);return r};r.props=o.props;try{G2.register(t,r)}catch(e){}}})();
1
+ G2.register("data.column",e=>{const{value:t}=e;return async()=>{let e=t;if("string"==typeof t){const o=await fetch(t);e=await o.json()}const o=Object.keys(e);return 0===o.length?[]:e[o[0]].map((t,r)=>o.reduce((t,o)=>(t[o]=e[o][r],t),{}))}}),(()=>{const e=4/3,t=/[fF]ontSize$/,o=e=>e&&"object"==typeof e&&!Array.isArray(e),r=n=>{if(o(n))for(const[s,c]of Object.entries(n))o(c)?r(c):"number"==typeof c&&t.test(s)&&(n[s]=c*e)},n=t=>{if(r(t),o(t.legendCategory)&&"number"==typeof t.legendCategory.itemMarkerSize&&(t.legendCategory.itemMarkerSize*=e),o(t.point))for(const e of Object.values(t.point))o(e)&&"number"==typeof e.r&&(e.r=4);return o(t.axis)&&(t.axis.gridStrokeOpacity=.25),t.inset=16,t};for(const e of["Light","Dark","Classic","ClassicDark","Academy"]){const t=G2[e];if("function"!=typeof t)continue;let o;G2[e]=(...e)=>o??=n(t(...e));const r="theme."+e[0].toLowerCase()+e.slice(1);try{G2.register(r,G2[e])}catch(e){}}const s=()=>(e,t)=>{if(void 0!==t.encode.size)return[e,t];const o=[];for(const t of e)o[t]=4;return[e,{...t,encode:{...t.encode,size:{type:"column",value:o,visual:!0}}}]};s.props={};const c=G2.corelib();for(const e of["mark.point","mark.beeswarm"])for(const[t,o]of(c[e]?.props?.postInference??[]).entries())o.type===G2.MaybeSize&&(c[e].props.postInference[t]={type:s});for(const e of["mark.point","mark.beeswarm"]){const t=c[e];if(!t?.props?.shape)continue;t.props.defaultShape="point";const o=Object.fromEntries(Object.entries(t.props.shape).sort(([e],[t])=>/^hollow/.test(e)-/^hollow/.test(t)));t.props.shape=o;for(const e of t.props.channels||[])"shape"===e.name&&(e.range=Object.keys(o))}const a=G2.graphlib?.()??{};for(const t of["mark.sankey","mark.chord","mark.treemap"]){const o=a[t];if("function"!=typeof o)continue;const r=function(...t){const r=o.apply(this,t);for(const t of Array.isArray(r)?r:[r])if(Array.isArray(t?.labels))for(const o of t.labels)"number"==typeof o?.fontSize&&(o.fontSize*=e);return r};r.props=o.props;try{G2.register(t,r)}catch(e){}}})();
2
2
  //# sourceMappingURL=g2-patches.min.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiee/utils",
3
- "version": "1.14.30",
3
+ "version": "1.14.31",
4
4
  "description": "Miscellaneous tools and utilities to manipulate HTML pages",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"