@bitblit/ratchet-echarts 4.0.353-alpha → 4.0.355-alpha

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/lib/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import*as r from"echarts";import{Canvas as t}from"canvas";import e from"fs";class n{constructor(){}static buildInformation(){return{version:"353",hash:"2c20656162db96c96be797b086872b1406c7d521",branch:"alpha-2024-05-12-16",tag:"alpha-2024-05-12-16",timeBuiltISO:"2024-05-12T23:05:35-0700",notes:"No notes"}}}class a{static async renderChartUsingProvidedCanvas(t,e){if(!t)throw new Error("You must supply an opts parameter");if(!e)throw new Error("You must supply an canvas parameter");let n=null;t.animation=!1;const a=e;return r.init(a).setOption(t),n=e.toBuffer(),n}static async renderChart(r,e){if(!r)throw new Error("You must supply an opts parameter");if(!e)throw new Error("You must supply an config parameter");const n=new t(e.width,e.height);return await this.renderChartUsingProvidedCanvas(r,n)}static async renderChartToPngFile(r,t,n){if(!t)throw new Error("You must supply an opts parameter");if(!n)throw new Error("You must supply an config parameter");if(!r||0===r.trim().length)throw new Error("You must supply a non-empty filename parameter");if(!r.toLowerCase().endsWith(".png"))throw new Error("Your filename should end with .png - this generates a png file");const a=await this.renderChart(t,n);return e.writeFileSync(r,a),a}}export{a as EChartRatchet,n as RatchetEchartsInfo};
1
+ import*as r from"echarts";import{Canvas as t}from"canvas";import e from"fs";class n{constructor(){}static buildInformation(){return{version:"355",hash:"c2b3df5c6ecad573d661cbd4a241da9d002d184c",branch:"alpha-2024-05-13-2",tag:"alpha-2024-05-13-2",timeBuiltISO:"2024-05-13T10:52:10-0700",notes:"No notes"}}}class a{static async renderChartUsingProvidedCanvas(t,e){if(!t)throw new Error("You must supply an opts parameter");if(!e)throw new Error("You must supply an canvas parameter");let n=null;t.animation=!1;const a=e;return r.init(a).setOption(t),n=e.toBuffer(),n}static async renderChart(r,e){if(!r)throw new Error("You must supply an opts parameter");if(!e)throw new Error("You must supply an config parameter");const n=new t(e.width,e.height);return await this.renderChartUsingProvidedCanvas(r,n)}static async renderChartToPngFile(r,t,n){if(!t)throw new Error("You must supply an opts parameter");if(!n)throw new Error("You must supply an config parameter");if(!r||0===r.trim().length)throw new Error("You must supply a non-empty filename parameter");if(!r.toLowerCase().endsWith(".png"))throw new Error("Your filename should end with .png - this generates a png file");const a=await this.renderChart(t,n);return e.writeFileSync(r,a),a}}export{a as EChartRatchet,n as RatchetEchartsInfo};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,9 +1,21 @@
1
- /// <reference types="node" />
1
+ import { BuildInformation } from '@bitblit/ratchet-common';
2
2
  import { EChartsOption } from 'echarts';
3
3
  import { Canvas } from 'canvas';
4
- import { EChartCanvasConfig } from './echart-canvas-config.js';
5
- export declare class EChartRatchet {
4
+
5
+ declare class RatchetEchartsInfo {
6
+ private constructor();
7
+ static buildInformation(): BuildInformation;
8
+ }
9
+
10
+ interface EChartCanvasConfig {
11
+ width: number;
12
+ height: number;
13
+ }
14
+
15
+ declare class EChartRatchet {
6
16
  static renderChartUsingProvidedCanvas(opt: EChartsOption, canvas: Canvas): Promise<Buffer>;
7
17
  static renderChart(opts: EChartsOption, config: EChartCanvasConfig): Promise<Buffer>;
8
18
  static renderChartToPngFile(filename: string, opts: EChartsOption, config: EChartCanvasConfig): Promise<Buffer>;
9
19
  }
20
+
21
+ export { type EChartCanvasConfig, EChartRatchet, RatchetEchartsInfo };
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@bitblit/ratchet-echarts",
3
- "version": "4.0.353-alpha",
3
+ "version": "4.0.355-alpha",
4
4
  "description": "Library for using echarts on Node",
5
5
  "type": "module",
6
6
  "module": "./lib/index.mjs",
7
- "types": "./lib/index.d.ts",
7
+ "types": "./lib/types.d.ts",
8
8
  "files": [
9
9
  "lib/**",
10
10
  "bin/**"
11
11
  ],
12
12
  "exports": {
13
13
  ".": {
14
- "types": "./lib/index.d.ts",
14
+ "types": "./lib/types.d.ts",
15
15
  "import": "./lib/index.mjs"
16
16
  }
17
17
  },
@@ -31,12 +31,12 @@
31
31
  "config": {},
32
32
  "license": "Apache-2.0",
33
33
  "dependencies": {
34
- "@bitblit/ratchet-common": "4.0.353-alpha",
34
+ "@bitblit/ratchet-common": "4.0.355-alpha",
35
35
  "canvas": "2.11.2",
36
36
  "echarts": "5.5.0"
37
37
  },
38
38
  "peerDependencies": {
39
- "@bitblit/ratchet-common": "4.0.353-alpha",
39
+ "@bitblit/ratchet-common": "4.0.355-alpha",
40
40
  "canvas": "^2.11.2",
41
41
  "echarts": "^5.5.0"
42
42
  }
@@ -1,5 +0,0 @@
1
- import { BuildInformation } from '@bitblit/ratchet-common';
2
- export declare class RatchetEchartsInfo {
3
- private constructor();
4
- static buildInformation(): BuildInformation;
5
- }
@@ -1,4 +0,0 @@
1
- export interface EChartCanvasConfig {
2
- width: number;
3
- height: number;
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
package/lib/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from './build/ratchet-echarts-info.js';
2
- export * from './common/echart-canvas-config.js';
3
- export * from './common/echart-ratchet.js';
package/lib/index.mjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/build/ratchet-echarts-info.ts","../src/common/echart-ratchet.ts"],"sourcesContent":[null,null],"names":["RatchetEchartsInfo","constructor","buildInformation","version","hash","branch","tag","timeBuiltISO","notes","EChartRatchet","renderChartUsingProvidedCanvas","opt","canvas","Error","rval","animation","canvasHtml","echarts","init","setOption","toBuffer","renderChart","opts","config","Canvas","width","height","this","renderChartToPngFile","filename","trim","length","toLowerCase","endsWith","fs","writeFileSync"],"mappings":"kFAEaA,EAGX,WAAAC,GAAwB,CAEjB,uBAAOC,GASZ,MAR8B,CAC5BC,QAAS,iBACTC,KAAM,aACNC,OAAQ,eACRC,IAAK,YACLC,aAAc,iBACdC,MAAO,cAGV,QCXUC,EACJ,2CAAaC,CAA+BC,EAAoBC,GACrE,IAAKD,EACH,MAAM,IAAIE,MAAM,qCAElB,IAAKD,EACH,MAAM,IAAIC,MAAM,uCAElB,IAAIC,EAAe,KAEnBH,EAAII,WAAY,EAChB,MAAMC,EAA0BJ,EAMhC,OAHuBK,EAAQC,KAAKF,GAC9BG,UAAUR,GAChBG,EAAOF,EAAOQ,WACPN,CACR,CAEM,wBAAaO,CAAYC,EAAqBC,GACnD,IAAKD,EACH,MAAM,IAAIT,MAAM,qCAElB,IAAKU,EACH,MAAM,IAAIV,MAAM,uCAElB,MAAMD,EAAiB,IAAIY,EAAOD,EAAOE,MAAOF,EAAOG,QAGvD,aAF2BC,KAAKjB,+BAA+BY,EAAMV,EAGtE,CAEM,iCAAagB,CAAqBC,EAAkBP,EAAqBC,GAC9E,IAAKD,EACH,MAAM,IAAIT,MAAM,qCAElB,IAAKU,EACH,MAAM,IAAIV,MAAM,uCAElB,IAAKgB,GAAuC,IAA3BA,EAASC,OAAOC,OAC/B,MAAM,IAAIlB,MAAM,kDAElB,IAAKgB,EAASG,cAAcC,SAAS,QACnC,MAAM,IAAIpB,MAAM,kEAElB,MAAMC,QAAqBa,KAAKN,YAAYC,EAAMC,GAGlD,OAFAW,EAAGC,cAAcN,EAAUf,GAEpBA,CACR"}