@antv/gpt-vis 1.0.0-beta.1 → 1.0.0-beta.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.
Files changed (157) hide show
  1. package/README.md +6 -4
  2. package/README.zh-CN.md +6 -4
  3. package/dist/cjs/gpt-vis/index.d.ts +8 -1
  4. package/dist/cjs/gpt-vis/index.js +43 -20
  5. package/dist/cjs/index.d.ts +15 -2
  6. package/dist/cjs/index.js +22 -2
  7. package/dist/cjs/syntax/parser.d.ts +17 -2
  8. package/dist/cjs/syntax/parser.js +151 -38
  9. package/dist/cjs/util/container.d.ts +5 -0
  10. package/dist/cjs/util/container.js +43 -0
  11. package/dist/cjs/util/theme.d.ts +5 -0
  12. package/dist/cjs/util/theme.js +9 -2
  13. package/dist/cjs/vis/area/index.js +2 -1
  14. package/dist/cjs/vis/bar/index.js +5 -4
  15. package/dist/cjs/vis/boxplot/index.js +7 -2
  16. package/dist/cjs/vis/column/index.js +5 -4
  17. package/dist/cjs/vis/dual-axes/index.js +2 -1
  18. package/dist/cjs/vis/fishbone-diagram/index.d.ts +35 -0
  19. package/dist/cjs/vis/fishbone-diagram/index.js +183 -0
  20. package/dist/cjs/vis/flow-diagram/index.d.ts +27 -0
  21. package/dist/cjs/vis/flow-diagram/index.js +271 -0
  22. package/dist/cjs/vis/funnel/index.js +2 -1
  23. package/dist/cjs/vis/histogram/index.js +3 -7
  24. package/dist/cjs/vis/indented-tree/index.d.ts +40 -0
  25. package/dist/cjs/vis/indented-tree/index.js +375 -0
  26. package/dist/cjs/vis/line/index.js +2 -1
  27. package/dist/cjs/vis/liquid/index.js +2 -1
  28. package/dist/cjs/vis/mindmap/index.d.ts +32 -0
  29. package/dist/cjs/vis/mindmap/index.js +214 -0
  30. package/dist/cjs/vis/network-graph/index.d.ts +59 -0
  31. package/dist/cjs/vis/network-graph/index.js +166 -0
  32. package/dist/cjs/vis/organization-chart/index.d.ts +64 -0
  33. package/dist/cjs/vis/organization-chart/index.js +191 -0
  34. package/dist/cjs/vis/pie/index.js +3 -3
  35. package/dist/cjs/vis/radar/index.d.ts +1 -0
  36. package/dist/cjs/vis/radar/index.js +10 -9
  37. package/dist/cjs/vis/sankey/index.js +2 -1
  38. package/dist/cjs/vis/scatter/index.js +2 -1
  39. package/dist/cjs/vis/summary/index.js +17 -3
  40. package/dist/cjs/vis/table/index.d.ts +1 -0
  41. package/dist/cjs/vis/table/index.js +37 -1
  42. package/dist/cjs/vis/treemap/index.js +2 -1
  43. package/dist/cjs/vis/venn/index.d.ts +2 -1
  44. package/dist/cjs/vis/venn/index.js +18 -3
  45. package/dist/cjs/vis/violin/index.js +2 -1
  46. package/dist/cjs/vis/waterfall/index.d.ts +6 -9
  47. package/dist/cjs/vis/waterfall/index.js +28 -5
  48. package/dist/cjs/vis/word-cloud/index.js +2 -1
  49. package/dist/cjs/vis-wrapper/icons.js +2 -2
  50. package/dist/cjs/vis-wrapper/index.d.ts +1 -0
  51. package/dist/cjs/vis-wrapper/index.js +27 -16
  52. package/dist/cjs/vis-wrapper/styles.d.ts +1 -1
  53. package/dist/cjs/vis-wrapper/styles.js +8 -1
  54. package/dist/esm/gpt-vis/index.d.ts +8 -1
  55. package/dist/esm/gpt-vis/index.js +47 -26
  56. package/dist/esm/index.d.ts +15 -2
  57. package/dist/esm/index.js +7 -1
  58. package/dist/esm/syntax/parser.d.ts +17 -2
  59. package/dist/esm/syntax/parser.js +248 -90
  60. package/dist/esm/util/container.d.ts +5 -0
  61. package/dist/esm/util/container.js +20 -0
  62. package/dist/esm/util/theme.d.ts +5 -0
  63. package/dist/esm/util/theme.js +9 -0
  64. package/dist/esm/vis/area/index.js +3 -2
  65. package/dist/esm/vis/bar/index.js +7 -6
  66. package/dist/esm/vis/boxplot/index.js +17 -4
  67. package/dist/esm/vis/column/index.js +7 -6
  68. package/dist/esm/vis/dual-axes/index.js +3 -2
  69. package/dist/esm/vis/fishbone-diagram/index.d.ts +35 -0
  70. package/dist/esm/vis/fishbone-diagram/index.js +218 -0
  71. package/dist/esm/vis/flow-diagram/index.d.ts +27 -0
  72. package/dist/esm/vis/flow-diagram/index.js +342 -0
  73. package/dist/esm/vis/funnel/index.js +3 -2
  74. package/dist/esm/vis/histogram/index.js +6 -7
  75. package/dist/esm/vis/indented-tree/index.d.ts +40 -0
  76. package/dist/esm/vis/indented-tree/index.js +564 -0
  77. package/dist/esm/vis/line/index.js +3 -2
  78. package/dist/esm/vis/liquid/index.js +3 -2
  79. package/dist/esm/vis/mindmap/index.d.ts +32 -0
  80. package/dist/esm/vis/mindmap/index.js +315 -0
  81. package/dist/esm/vis/network-graph/index.d.ts +59 -0
  82. package/dist/esm/vis/network-graph/index.js +240 -0
  83. package/dist/esm/vis/organization-chart/index.d.ts +64 -0
  84. package/dist/esm/vis/organization-chart/index.js +269 -0
  85. package/dist/esm/vis/pie/index.js +4 -8
  86. package/dist/esm/vis/radar/index.d.ts +1 -0
  87. package/dist/esm/vis/radar/index.js +20 -4
  88. package/dist/esm/vis/sankey/index.js +3 -2
  89. package/dist/esm/vis/scatter/index.js +3 -2
  90. package/dist/esm/vis/summary/index.js +25 -4
  91. package/dist/esm/vis/table/index.d.ts +1 -0
  92. package/dist/esm/vis/table/index.js +9 -2
  93. package/dist/esm/vis/treemap/index.js +3 -2
  94. package/dist/esm/vis/venn/index.d.ts +2 -1
  95. package/dist/esm/vis/venn/index.js +29 -4
  96. package/dist/esm/vis/violin/index.js +3 -2
  97. package/dist/esm/vis/waterfall/index.d.ts +6 -9
  98. package/dist/esm/vis/waterfall/index.js +27 -9
  99. package/dist/esm/vis/word-cloud/index.js +3 -2
  100. package/dist/esm/vis-wrapper/icons.js +2 -2
  101. package/dist/esm/vis-wrapper/index.d.ts +1 -0
  102. package/dist/esm/vis-wrapper/index.js +15 -10
  103. package/dist/esm/vis-wrapper/styles.d.ts +1 -1
  104. package/dist/esm/vis-wrapper/styles.js +1 -1
  105. package/dist/umd/index.min.js +1 -1
  106. package/package.json +19 -19
  107. package/src/gpt-vis/index.ts +0 -283
  108. package/src/index.ts +0 -44
  109. package/src/readme.md +0 -37
  110. package/src/syntax/index.ts +0 -2
  111. package/src/syntax/parser.ts +0 -411
  112. package/src/types/index.ts +0 -29
  113. package/src/util/theme.ts +0 -167
  114. package/src/vis/area/README.md +0 -143
  115. package/src/vis/area/index.ts +0 -212
  116. package/src/vis/bar/README.md +0 -158
  117. package/src/vis/bar/index.ts +0 -186
  118. package/src/vis/boxplot/README.md +0 -168
  119. package/src/vis/boxplot/index.ts +0 -162
  120. package/src/vis/column/README.md +0 -158
  121. package/src/vis/column/index.ts +0 -185
  122. package/src/vis/dual-axes/README.md +0 -191
  123. package/src/vis/dual-axes/index.ts +0 -218
  124. package/src/vis/funnel/README.md +0 -143
  125. package/src/vis/funnel/index.ts +0 -238
  126. package/src/vis/histogram/README.md +0 -130
  127. package/src/vis/histogram/index.ts +0 -153
  128. package/src/vis/line/README.md +0 -138
  129. package/src/vis/line/index.ts +0 -159
  130. package/src/vis/liquid/README.md +0 -150
  131. package/src/vis/liquid/index.ts +0 -130
  132. package/src/vis/pie/README.md +0 -127
  133. package/src/vis/pie/index.ts +0 -163
  134. package/src/vis/radar/README.md +0 -184
  135. package/src/vis/radar/index.ts +0 -214
  136. package/src/vis/sankey/README.md +0 -144
  137. package/src/vis/sankey/index.ts +0 -144
  138. package/src/vis/scatter/README.md +0 -145
  139. package/src/vis/scatter/index.ts +0 -147
  140. package/src/vis/summary/README.md +0 -272
  141. package/src/vis/summary/index.ts +0 -91
  142. package/src/vis/table/README.md +0 -174
  143. package/src/vis/table/index.ts +0 -241
  144. package/src/vis/treemap/README.md +0 -199
  145. package/src/vis/treemap/index.ts +0 -167
  146. package/src/vis/venn/README.md +0 -153
  147. package/src/vis/venn/index.ts +0 -149
  148. package/src/vis/violin/README.md +0 -168
  149. package/src/vis/violin/index.ts +0 -216
  150. package/src/vis/waterfall/README.md +0 -178
  151. package/src/vis/waterfall/index.ts +0 -258
  152. package/src/vis/word-cloud/README.md +0 -137
  153. package/src/vis/word-cloud/index.ts +0 -137
  154. package/src/vis-wrapper/README.md +0 -159
  155. package/src/vis-wrapper/icons.ts +0 -35
  156. package/src/vis-wrapper/index.ts +0 -276
  157. package/src/vis-wrapper/styles.ts +0 -195
@@ -1,137 +0,0 @@
1
- # WordCloud
2
-
3
- A word cloud chart component for visualizing word frequency or importance, built with G2 5.0.
4
-
5
- ## Usage
6
-
7
- ```ts
8
- import { WordCloud } from '@antv/gpt-vis/ai';
9
-
10
- const wordCloud = WordCloud({
11
- container: '#container',
12
- width: 600,
13
- height: 400,
14
- });
15
-
16
- wordCloud.render({
17
- data: [
18
- { text: '环境', value: 20 },
19
- { text: '保护', value: 15 },
20
- { text: '可持续发展', value: 10 },
21
- ],
22
- });
23
-
24
- wordCloud.destroy();
25
- ```
26
-
27
- ## Configuration
28
-
29
- ### Constructor Options (WordCloudOptions)
30
-
31
- | Property | Type | Default | Description |
32
- | --------- | --------------------- | ------- | ----------------------------- |
33
- | container | string \| HTMLElement | - | Container element or selector |
34
- | width | number | 640 | Chart width in pixels |
35
- | height | number | 480 | Chart height in pixels |
36
-
37
- ### Render Config (WordCloudConfig)
38
-
39
- | Property | Type | Default | Description |
40
- | -------- | ------ | --------- | ------------------------- |
41
- | data | Array | - | Chart data array |
42
- | theme | string | 'default' | Color theme |
43
- | title | string | - | Chart title |
44
- | style | object | - | Chart style configuration |
45
-
46
- ### Data Structure
47
-
48
- ```ts
49
- type WordCloudDataItem = {
50
- text: string; // The word to display
51
- value: number; // The importance/frequency score
52
- };
53
- ```
54
-
55
- ### Style Options
56
-
57
- ```ts
58
- style?: {
59
- backgroundColor?: string; // Background color
60
- palette?: string[]; // Color palette
61
- }
62
- ```
63
-
64
- ## Examples
65
-
66
- ### Basic Example
67
-
68
- ```ts
69
- wordCloud.render({
70
- data: [
71
- { text: '数据', value: 50 },
72
- { text: '分析', value: 40 },
73
- { text: '结果', value: 30 },
74
- ],
75
- });
76
- ```
77
-
78
- ### With Theme
79
-
80
- ```ts
81
- wordCloud.render({
82
- data: [
83
- { text: '环境', value: 20 },
84
- { text: '保护', value: 15 },
85
- { text: '可持续发展', value: 10 },
86
- ],
87
- theme: 'academy',
88
- });
89
- ```
90
-
91
- ### With Custom Styles
92
-
93
- ```ts
94
- wordCloud.render({
95
- data: [
96
- { text: '质量好', value: 30 },
97
- { text: '价格合理', value: 20 },
98
- { text: '服务差', value: 5 },
99
- ],
100
- style: {
101
- palette: ['#FF6B6B', '#4ECDC4', '#45B7D1'],
102
- },
103
- });
104
- ```
105
-
106
- ### With Title
107
-
108
- ```ts
109
- wordCloud.render({
110
- data: [
111
- { text: '环保', value: 10 },
112
- { text: '气候变化', value: 8 },
113
- { text: '可再生能源', value: 6 },
114
- { text: '碳排放', value: 5 },
115
- { text: '绿色生活', value: 4 },
116
- ],
117
- title: '环保关键词',
118
- });
119
- ```
120
-
121
- ### Dark Theme
122
-
123
- ```ts
124
- wordCloud.render({
125
- data: [
126
- { text: '环境', value: 20 },
127
- { text: '保护', value: 15 },
128
- { text: '可持续发展', value: 10 },
129
- ],
130
- theme: 'dark',
131
- });
132
- ```
133
-
134
- ## Methods
135
-
136
- - `render(config: WordCloudConfig): void` - Render or update the chart
137
- - `destroy(): void` - Destroy the chart instance and clean up resources
@@ -1,137 +0,0 @@
1
- import { Chart } from '@antv/g2';
2
- import type { VisualizationOptions } from '../../types';
3
- import { getBackgroundColor, getThemeColors, getThemeObject } from '../../util/theme';
4
-
5
- /**
6
- * WordCloudDataItem is the type for each data item in the word cloud chart.
7
- */
8
- export type WordCloudDataItem = {
9
- text: string;
10
- value: number;
11
- };
12
-
13
- /**
14
- * WordCloudConfig defines the configuration for rendering the word cloud chart.
15
- */
16
- export interface WordCloudConfig {
17
- type?: 'word-cloud';
18
- data: WordCloudDataItem[];
19
- theme?: 'default' | 'academy' | 'dark';
20
- title?: string;
21
- style?: {
22
- backgroundColor?: string;
23
- palette?: string[];
24
- };
25
- }
26
-
27
- /**
28
- * WordCloudInstance represents a word cloud chart instance with render and destroy methods.
29
- */
30
- export interface WordCloudInstance {
31
- render: (config: WordCloudConfig) => void;
32
- destroy: () => void;
33
- }
34
-
35
- /**
36
- * WordCloud chart component using G2 5.0.
37
- *
38
- * @example
39
- * ```ts
40
- * const wordCloud = WordCloud({
41
- * container: '#container',
42
- * width: 600,
43
- * height: 400,
44
- * });
45
- *
46
- * wordCloud.render({
47
- * type: 'word-cloud',
48
- * data: [
49
- * { text: '环境', value: 20 },
50
- * { text: '保护', value: 15 },
51
- * { text: '可持续发展', value: 10 },
52
- * ],
53
- * theme: 'academy'
54
- * });
55
- *
56
- * wordCloud.destroy();
57
- * ```
58
- */
59
- export const WordCloud = (options: VisualizationOptions): WordCloudInstance => {
60
- const { container, width, height, theme: chartTheme = 'default' } = options;
61
- let chart: Chart | null = null;
62
-
63
- /**
64
- * Render the word cloud chart with the given configuration.
65
- */
66
- const render = (config: WordCloudConfig): void => {
67
- const { data = [], theme = chartTheme, title, style = {} } = config;
68
-
69
- // Clean up previous chart if exists
70
- if (chart) {
71
- chart.destroy();
72
- }
73
-
74
- // Get colors from style.palette or theme defaults
75
- const colors = style.palette || getThemeColors(theme);
76
- const backgroundColor = style.backgroundColor || getBackgroundColor(theme);
77
-
78
- // Create chart
79
- chart = new Chart({
80
- container,
81
- width,
82
- height,
83
- autoFit: true,
84
- });
85
-
86
- // Configure chart options
87
- // Note: Using 'any' type due to G2's complex type system with transformations
88
- // This is consistent with how G2 5.0 is used elsewhere in the codebase
89
- const chartOptions: any = {
90
- type: 'wordCloud',
91
- data,
92
- title: title ?? '',
93
- layout: {
94
- fontSize: [8, 42],
95
- },
96
- encode: {
97
- text: 'text',
98
- color: 'text',
99
- value: 'value',
100
- },
101
- scale: {
102
- color: { range: colors },
103
- },
104
- legend: false,
105
- tooltip: {
106
- items: [
107
- (d: any) => ({
108
- name: d.text,
109
- value: d.value,
110
- }),
111
- ],
112
- },
113
- viewStyle: {
114
- viewFill: backgroundColor,
115
- },
116
- theme: getThemeObject(theme),
117
- };
118
-
119
- chart.options(chartOptions);
120
- chart.render();
121
- };
122
-
123
- /**
124
- * Destroy the chart instance and clean up resources.
125
- */
126
- const destroy = (): void => {
127
- if (chart) {
128
- chart.destroy();
129
- chart = null;
130
- }
131
- };
132
-
133
- return {
134
- render,
135
- destroy,
136
- };
137
- };
@@ -1,159 +0,0 @@
1
- # GPT-Vis Wrapper Feature
2
-
3
- ## Overview
4
-
5
- The wrapper feature adds an outer container to GPTVis charts with built-in UI controls for enhanced user interaction. When enabled, charts are displayed with tabs, buttons, and additional functionality.
6
-
7
- ## Features
8
-
9
- ### Chart Tab
10
-
11
- - **Download Chart**: Export the chart as a PNG image
12
- - **Zoom Controls** (for G6 charts only):
13
- - Zoom in/out buttons for charts like mind-map, network-graph, flow-diagram, organization-chart, indented-tree, and fishbone-diagram
14
-
15
- ### Code Tab
16
-
17
- - **View Configuration**: Switch to code view to see the JSON configuration of the chart
18
- - **Copy Code**: Copy the chart configuration to clipboard with one click
19
-
20
- ## Usage
21
-
22
- ### Basic Example
23
-
24
- ```typescript
25
- import { GPTVis } from '@antv/gpt-vis';
26
-
27
- // Create a GPTVis instance with wrapper enabled
28
- const g = new GPTVis({
29
- container: '#container',
30
- width: 600,
31
- height: 400,
32
- wrapper: true, // Enable the wrapper (default: false)
33
- });
34
-
35
- // Render a chart
36
- g.render({
37
- type: 'pie',
38
- data: [
39
- { category: '分类一', value: 27 },
40
- { category: '分类二', value: 25 },
41
- { category: '分类三', value: 18 },
42
- ],
43
- innerRadius: 0.6,
44
- theme: 'academy',
45
- });
46
-
47
- // Clean up when done
48
- g.destroy();
49
- ```
50
-
51
- ### Without Wrapper (Default)
52
-
53
- ```typescript
54
- const g = new GPTVis({
55
- container: '#container',
56
- width: 600,
57
- height: 400,
58
- wrapper: false, // Or omit this option (default is false)
59
- });
60
- ```
61
-
62
- ### With G6 Charts (Zoom Controls)
63
-
64
- For G6-based charts (mind-map, network-graph, flow-diagram, etc.), the wrapper automatically displays zoom in/out buttons:
65
-
66
- ```typescript
67
- const g = new GPTVis({
68
- container: '#container',
69
- width: 600,
70
- height: 400,
71
- wrapper: true,
72
- });
73
-
74
- g.render({
75
- type: 'mind-map',
76
- data: {
77
- name: '项目管理',
78
- children: [
79
- {
80
- name: '计划阶段',
81
- children: [{ name: '需求分析' }, { name: '资源规划' }],
82
- },
83
- {
84
- name: '执行阶段',
85
- children: [{ name: '任务分配' }, { name: '进度跟踪' }],
86
- },
87
- ],
88
- },
89
- theme: 'default',
90
- });
91
- ```
92
-
93
- ## Implementation Details
94
-
95
- ### Architecture
96
-
97
- 1. **VisualizationOptions Interface**: Added `wrapper?: boolean` option (default: false)
98
- 2. **createVisWrapper Function**: Creates the wrapper HTML structure with tabs and controls
99
- 3. **GPTVis Integration**: When `wrapper: true`, the GPTVis class creates a wrapper container and renders the chart inside it
100
-
101
- ### Wrapper Components
102
-
103
- - **Tab Header**: Contains chart/code tabs and action buttons
104
- - **Tab Content**: Displays either the chart or the JSON configuration
105
- - **Chart Container**: The actual chart rendering area
106
- - **Code Container**: Shows formatted JSON with syntax highlighting
107
-
108
- ### Styling
109
-
110
- The wrapper uses inline styles injected via a `<style>` tag to ensure no conflicts with existing styles. The design follows the reference from the original React component.
111
-
112
- ## Supported Chart Types with Zoom
113
-
114
- The following chart types support zoom controls when wrapper is enabled:
115
-
116
- - mind-map (思维导图)
117
- - fishbone-diagram (鱼骨图)
118
- - flow-diagram (流程图)
119
- - organization-chart (组织架构图)
120
- - network-graph (网络图)
121
- - indented-tree (缩进树)
122
-
123
- ## Browser Compatibility
124
-
125
- The wrapper feature requires:
126
-
127
- - Modern browser with ES6+ support
128
- - `navigator.clipboard` API for copy functionality
129
- - `snapdom` library for chart image export
130
-
131
- ## API Reference
132
-
133
- ### VisualizationOptions
134
-
135
- ```typescript
136
- interface VisualizationOptions {
137
- container: string | HTMLElement; // Container selector or element
138
- width?: number; // Chart width
139
- height?: number; // Chart height
140
- wrapper?: boolean; // Enable wrapper (default: false)
141
- }
142
- ```
143
-
144
- ### GPTVis Methods
145
-
146
- ```typescript
147
- class GPTVis {
148
- constructor(options: VisualizationOptions);
149
- render(config: GPTVisConfig): void;
150
- destroy(): void;
151
- }
152
- ```
153
-
154
- ## Notes
155
-
156
- - The wrapper is disabled by default (`wrapper: false`) to maintain backward compatibility
157
- - Only affects the `GPTVis` unified API, not individual chart components
158
- - Wrapper styles are automatically injected when the wrapper is first created
159
- - Multiple GPTVis instances can use wrappers independently
@@ -1,35 +0,0 @@
1
- /**
2
- * Create SVG icon elements for the wrapper UI
3
- */
4
-
5
- export function createCopyIcon(size = 14, fill = '#707070'): string {
6
- return `<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="${fill}">
7
- <path d="M768 682.666667V170.666667a85.333333 85.333333 0 0 0-85.333333-85.333334H170.666667a85.333333 85.333333 0 0 0-85.333334 85.333334v512a85.333333 85.333333 0 0 0 85.333334 85.333333h512a85.333333 85.333333 0 0 0 85.333333-85.333333zM170.666667 170.666667h512v512H170.666667z m682.666666 85.333333v512a85.333333 85.333333 0 0 1-85.333333 85.333333H256a85.333333 85.333333 0 0 0 85.333333 85.333334h426.666667a170.666667 170.666667 0 0 0 170.666667-170.666667V341.333333a85.333333 85.333333 0 0 0-85.333334-85.333333z"></path>
8
- </svg>`;
9
- }
10
-
11
- export function createCheckIcon(size = 14, fill = '#707070'): string {
12
- return `<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="${fill}">
13
- <path d="M380.416 822.144c-10.432 0-20.864-3.968-28.8-11.968L75.968 534.592c-15.936-15.936-15.936-41.664 0-57.6 15.872-15.872 41.664-15.872 57.536 0L380.416 723.84l510.08-510.016c15.872-15.936 41.664-15.936 57.536 0 15.936 15.936 15.936 41.664 0 57.6L409.216 810.24c-7.936 7.936-18.368 11.904-28.8 11.904z"></path>
14
- </svg>`;
15
- }
16
-
17
- export function createDownloadIcon(size = 14, fill = '#707070'): string {
18
- return `<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="${fill}">
19
- <path d="M512 165.93q13.645 0 23.31 9.666t9.665 23.31V580.77L653.37 472.103q9.517-9.517 23.434-9.517 14.164 0 23.558 9.394t9.393 23.557q0 13.917-9.517 23.434L535.434 683.774q-9.517 9.517-23.434 9.517t-23.434-9.517L323.763 518.971q-9.517-10.036-9.517-23.434 0-13.645 9.665-23.31t23.31-9.665q13.917 0 23.434 9.516L479.05 580.744V198.881q0-13.645 9.665-23.31t23.31-9.665z m329.582 461.435q13.645 0 23.31 9.665t9.665 23.31v131.828q0 41.207-28.575 69.782-29.095 29.095-69.536 29.095H248.32q-40.416 0-70.03-28.848-28.847-29.613-28.847-70.03V660.34q0-13.645 9.665-23.31t23.31-9.665 23.31 9.665 9.666 23.31v131.828q0 13.645 9.665 23.31t23.31 9.665h528.127q13.398 0 22.791-9.665t9.393-23.31V660.34q0-13.645 9.666-23.31t23.31-9.665z"></path>
20
- </svg>`;
21
- }
22
-
23
- export function createZoomInIcon(size = 18, fill = '#707070'): string {
24
- return `<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="${fill}">
25
- <path d="M889.5 852.7l-220-219.9c45-53.4 72.1-122.3 72.1-197.5 0-169.4-137.8-307.3-307.3-307.3S127.1 265.8 127.1 435.3s137.8 307.3 307.3 307.3c76.1 0 145.7-27.8 199.4-73.8l219.8 219.8c4.9 5 11.4 7.4 17.9 7.4s13-2.5 17.9-7.4c10-9.9 10-26 0.1-35.9zM434.4 691.8c-141.4 0-256.5-115.1-256.5-256.5 0-141.5 115.1-256.5 256.5-256.5s256.5 115.1 256.5 256.5-115.1 256.5-256.5 256.5z"></path>
26
- <path d="M555 418.3H304.7c-14 0-25.4 11.4-25.4 25.4s11.4 25.4 25.4 25.4H555c14 0 25.4-11.4 25.4-25.4S569 418.3 555 418.3z"></path>
27
- </svg>`;
28
- }
29
-
30
- export function createZoomOutIcon(size = 18, fill = '#707070'): string {
31
- return `<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="${fill}">
32
- <path d="M889.5 852.7l-220-219.9c45-53.4 72.1-122.3 72.1-197.5 0-169.4-137.8-307.3-307.3-307.3S127.1 265.8 127.1 435.3s137.8 307.3 307.3 307.3c76.1 0 145.7-27.8 199.4-73.8l219.8 219.8c4.9 5 11.4 7.4 17.9 7.4s13-2.5 17.9-7.4c10-9.9 10-26 0.1-35.9zM434.4 691.8c-141.4 0-256.5-115.1-256.5-256.5 0-141.5 115.1-256.5 256.5-256.5s256.5 115.1 256.5 256.5-115.1 256.5-256.5 256.5z"></path>
33
- <path d="M555 418.3h-99.8v-99.8c0-14-11.4-25.4-25.4-25.4s-25.4 11.4-25.4 25.4v99.8h-99.8c-14 0-25.4 11.4-25.4 25.4s11.4 25.4 25.4 25.4h99.8v99.8c0 14 11.4 25.4 25.4 25.4s25.4-11.4 25.4-25.4v-99.8H555c14 0 25.4-11.4 25.4-25.4S569 418.3 555 418.3z"></path>
34
- </svg>`;
35
- }