@memberjunction/core-actions 2.107.0 → 2.109.0
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/dist/custom/ai/find-best-action.action.d.ts +53 -0
- package/dist/custom/ai/find-best-action.action.d.ts.map +1 -0
- package/dist/custom/ai/find-best-action.action.js +211 -0
- package/dist/custom/ai/find-best-action.action.js.map +1 -0
- package/dist/custom/ai/find-best-agent.action.d.ts +53 -0
- package/dist/custom/ai/find-best-agent.action.d.ts.map +1 -0
- package/dist/custom/ai/find-best-agent.action.js +194 -0
- package/dist/custom/ai/find-best-agent.action.js.map +1 -0
- package/dist/custom/ai/summarize-content.action.d.ts +3 -3
- package/dist/custom/ai/summarize-content.action.d.ts.map +1 -1
- package/dist/custom/ai/summarize-content.action.js +51 -143
- package/dist/custom/ai/summarize-content.action.js.map +1 -1
- package/dist/custom/code-execution/execute-code.action.d.ts +61 -0
- package/dist/custom/code-execution/execute-code.action.d.ts.map +1 -0
- package/dist/custom/code-execution/execute-code.action.js +172 -0
- package/dist/custom/code-execution/execute-code.action.js.map +1 -0
- package/dist/custom/data/csv-parser.action.js +1 -1
- package/dist/custom/data/csv-parser.action.js.map +1 -1
- package/dist/custom/data/execute-research-query.action.d.ts +36 -18
- package/dist/custom/data/execute-research-query.action.d.ts.map +1 -1
- package/dist/custom/data/execute-research-query.action.js +221 -114
- package/dist/custom/data/execute-research-query.action.js.map +1 -1
- package/dist/custom/data/explore-database-schema.action.d.ts +4 -0
- package/dist/custom/data/explore-database-schema.action.d.ts.map +1 -1
- package/dist/custom/data/explore-database-schema.action.js +101 -8
- package/dist/custom/data/explore-database-schema.action.js.map +1 -1
- package/dist/custom/data/get-entity-details.action.d.ts +63 -0
- package/dist/custom/data/get-entity-details.action.d.ts.map +1 -0
- package/dist/custom/data/get-entity-details.action.js +284 -0
- package/dist/custom/data/get-entity-details.action.js.map +1 -0
- package/dist/custom/data/get-entity-list.action.d.ts +57 -0
- package/dist/custom/data/get-entity-list.action.d.ts.map +1 -0
- package/dist/custom/data/get-entity-list.action.js +177 -0
- package/dist/custom/data/get-entity-list.action.js.map +1 -0
- package/dist/custom/visualization/create-svg-chart.action.d.ts +97 -0
- package/dist/custom/visualization/create-svg-chart.action.d.ts.map +1 -0
- package/dist/custom/visualization/create-svg-chart.action.js +326 -0
- package/dist/custom/visualization/create-svg-chart.action.js.map +1 -0
- package/dist/custom/visualization/create-svg-diagram.action.d.ts +151 -0
- package/dist/custom/visualization/create-svg-diagram.action.d.ts.map +1 -0
- package/dist/custom/visualization/create-svg-diagram.action.js +764 -0
- package/dist/custom/visualization/create-svg-diagram.action.js.map +1 -0
- package/dist/custom/visualization/create-svg-infographic.action.d.ts +72 -0
- package/dist/custom/visualization/create-svg-infographic.action.d.ts.map +1 -0
- package/dist/custom/visualization/create-svg-infographic.action.js +343 -0
- package/dist/custom/visualization/create-svg-infographic.action.js.map +1 -0
- package/dist/custom/visualization/create-svg-network.action.d.ts +106 -0
- package/dist/custom/visualization/create-svg-network.action.d.ts.map +1 -0
- package/dist/custom/visualization/create-svg-network.action.js +687 -0
- package/dist/custom/visualization/create-svg-network.action.js.map +1 -0
- package/dist/custom/visualization/create-svg-sketch-diagram.action.d.ts +97 -0
- package/dist/custom/visualization/create-svg-sketch-diagram.action.d.ts.map +1 -0
- package/dist/custom/visualization/create-svg-sketch-diagram.action.js +730 -0
- package/dist/custom/visualization/create-svg-sketch-diagram.action.js.map +1 -0
- package/dist/custom/visualization/create-svg-word-cloud.action.d.ts +94 -0
- package/dist/custom/visualization/create-svg-word-cloud.action.d.ts.map +1 -0
- package/dist/custom/visualization/create-svg-word-cloud.action.js +497 -0
- package/dist/custom/visualization/create-svg-word-cloud.action.js.map +1 -0
- package/dist/custom/visualization/shared/svg-theming.d.ts +91 -0
- package/dist/custom/visualization/shared/svg-theming.d.ts.map +1 -0
- package/dist/custom/visualization/shared/svg-theming.js +235 -0
- package/dist/custom/visualization/shared/svg-theming.js.map +1 -0
- package/dist/custom/visualization/shared/svg-types.d.ts +354 -0
- package/dist/custom/visualization/shared/svg-types.d.ts.map +1 -0
- package/dist/custom/visualization/shared/svg-types.js +11 -0
- package/dist/custom/visualization/shared/svg-types.js.map +1 -0
- package/dist/custom/visualization/shared/svg-utils.d.ts +166 -0
- package/dist/custom/visualization/shared/svg-utils.d.ts.map +1 -0
- package/dist/custom/visualization/shared/svg-utils.js +555 -0
- package/dist/custom/visualization/shared/svg-utils.js.map +1 -0
- package/dist/custom/web/google-custom-search.action.d.ts +6 -1
- package/dist/custom/web/google-custom-search.action.d.ts.map +1 -1
- package/dist/custom/web/google-custom-search.action.js +78 -10
- package/dist/custom/web/google-custom-search.action.js.map +1 -1
- package/dist/custom/web/web-page-content.action.d.ts +24 -0
- package/dist/custom/web/web-page-content.action.d.ts.map +1 -1
- package/dist/custom/web/web-page-content.action.js +90 -9
- package/dist/custom/web/web-page-content.action.js.map +1 -1
- package/dist/generated/action_subclasses.d.ts +4 -4
- package/dist/generated/action_subclasses.js +13 -13
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -1
- package/package.json +30 -12
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-svg-sketch-diagram.action.js","sourceRoot":"","sources":["../../../src/custom/visualization/create-svg-sketch-diagram.action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qDAAqD;AACrD,mDAAuD;AACvD,iCAA8B;AAC9B,sDAA4B;AAC5B,sDAAwC;AACxC,0DAA4C;AAY5C,kDAA8C;AAC9C,sDAA4E;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,oBAAU;IACxD;;;;;;;;;;;;;;;;;;;;OAoBG;IACO,KAAK,CAAC,iBAAiB,CAAC,MAAuB;QACrD,IAAI,CAAC;YACD,MAAM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QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;YAC1D,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;QAED,MAAM,IAAI,KAAK,CACX,cAAc,SAAS,0CAA0C;YACjE,YAAY,OAAO,KAAK,GAAG,CAC9B,CAAC;IACN,CAAC;IAED;;OAEG;IACK,aAAa,CAAC,MAAuB,EAAE,SAAiB;QAC5D,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC;QACjG,IAAI,KAAK,EAAE,KAAK,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;YAClD,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC;QACxC,CAAC;aAAM,CAAC;YACJ,OAAO,KAAK,EAAE,KAAK,IAAI,IAAI,CAAC;QAChC,CAAC;IACL,CAAC;CACJ,CAAA;AAxyBY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,sBAAa,EAAC,oBAAU,EAAE,0BAA0B,CAAC;GACzC,4BAA4B,CAwyBxC;AAED;;GAEG;AACH,SAAgB,gCAAgC;IAC5C,wCAAwC;AAC5C,CAAC;AAFD,4EAEC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { RunActionParams } from '@memberjunction/actions-base';
|
|
2
|
+
import { BaseAction } from '@memberjunction/actions';
|
|
3
|
+
import { SVGActionResult } from './shared/svg-types';
|
|
4
|
+
/**
|
|
5
|
+
* Action that generates SVG word clouds and tag bars from weighted word lists.
|
|
6
|
+
*
|
|
7
|
+
* This action provides server-side SVG generation for text visualizations, designed for
|
|
8
|
+
* AI agents and workflows to create publication-quality word clouds from data.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // Word cloud example
|
|
13
|
+
* await runAction({
|
|
14
|
+
* ActionName: 'Create SVG Word Cloud',
|
|
15
|
+
* Params: [
|
|
16
|
+
* { Name: 'CloudType', Value: 'cloud' },
|
|
17
|
+
* { Name: 'Words', Value: JSON.stringify([
|
|
18
|
+
* { text: 'TypeScript', weight: 100 },
|
|
19
|
+
* { text: 'JavaScript', weight: 80 },
|
|
20
|
+
* { text: 'React', weight: 60 },
|
|
21
|
+
* { text: 'Node.js', weight: 50 }
|
|
22
|
+
* ]) },
|
|
23
|
+
* { Name: 'MaxWords', Value: '50' },
|
|
24
|
+
* { Name: 'Rotation', Value: 'few' },
|
|
25
|
+
* { Name: 'Width', Value: '800' },
|
|
26
|
+
* { Name: 'Height', Value: '600' }
|
|
27
|
+
* ]
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* // Tag bar example
|
|
31
|
+
* await runAction({
|
|
32
|
+
* ActionName: 'Create SVG Word Cloud',
|
|
33
|
+
* Params: [
|
|
34
|
+
* { Name: 'CloudType', Value: 'tagbar' },
|
|
35
|
+
* { Name: 'Words', Value: JSON.stringify([
|
|
36
|
+
* { text: 'AI', weight: 67 },
|
|
37
|
+
* { text: 'Data', weight: 45 },
|
|
38
|
+
* { text: 'API', weight: 32 }
|
|
39
|
+
* ]) },
|
|
40
|
+
* { Name: 'MaxWords', Value: '10' }
|
|
41
|
+
* ]
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare class CreateSVGWordCloudAction extends BaseAction {
|
|
46
|
+
/**
|
|
47
|
+
* Generates an SVG word cloud from the provided data and configuration
|
|
48
|
+
*
|
|
49
|
+
* @param params - The action parameters containing:
|
|
50
|
+
* - CloudType: Type of visualization ('cloud' | 'tagbar')
|
|
51
|
+
* - Words: JSON array of {text, weight} objects
|
|
52
|
+
* - MaxWords: Maximum number of words to display (default: 50)
|
|
53
|
+
* - Rotation: Rotation strategy ('none' | 'few' | 'mixed') for clouds
|
|
54
|
+
* - MinFont: Minimum font size (default: 10)
|
|
55
|
+
* - MaxFont: Maximum font size (default: 80)
|
|
56
|
+
* - Seed: Random seed for deterministic layouts (optional)
|
|
57
|
+
* - Width: Width in pixels (optional, default: 800)
|
|
58
|
+
* - Height: Height in pixels (optional, default: 600)
|
|
59
|
+
* - Title: Visualization title (optional)
|
|
60
|
+
* - Palette: Color palette name (optional)
|
|
61
|
+
*
|
|
62
|
+
* @returns A promise resolving to an SVGActionResult
|
|
63
|
+
*/
|
|
64
|
+
protected InternalRunAction(params: RunActionParams): Promise<SVGActionResult>;
|
|
65
|
+
/**
|
|
66
|
+
* Renders a word cloud using d3-cloud
|
|
67
|
+
*/
|
|
68
|
+
private renderWordCloud;
|
|
69
|
+
/**
|
|
70
|
+
* Renders a tag bar visualization
|
|
71
|
+
*/
|
|
72
|
+
private renderTagBar;
|
|
73
|
+
/**
|
|
74
|
+
* Adds a title to the SVG
|
|
75
|
+
*/
|
|
76
|
+
private addTitle;
|
|
77
|
+
/**
|
|
78
|
+
* Helper to safely parse JSON that might already be an object
|
|
79
|
+
*/
|
|
80
|
+
private parseJSON;
|
|
81
|
+
/**
|
|
82
|
+
* Helper to ensure a parameter value is a string, with type conversion and validation
|
|
83
|
+
*/
|
|
84
|
+
private ensureString;
|
|
85
|
+
/**
|
|
86
|
+
* Helper to get parameter value by name (case-insensitive)
|
|
87
|
+
*/
|
|
88
|
+
private getParamValue;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Loader function to ensure the CreateSVGWordCloudAction class is included in the bundle.
|
|
92
|
+
*/
|
|
93
|
+
export declare function LoadCreateSVGWordCloudAction(): void;
|
|
94
|
+
//# sourceMappingURL=create-svg-word-cloud.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-svg-word-cloud.action.d.ts","sourceRoot":"","sources":["../../../src/custom/visualization/create-svg-word-cloud.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD,OAAO,EAAyB,eAAe,EAAqB,MAAM,oBAAoB,CAAC;AAO/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qBACa,wBAAyB,SAAQ,UAAU;IACpD;;;;;;;;;;;;;;;;;OAiBG;cACa,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;IAyFpF;;OAEG;YACW,eAAe;IAgM7B;;OAEG;YACW,YAAY;IAgG1B;;OAEG;IACH,OAAO,CAAC,QAAQ;IAahB;;OAEG;IACH,OAAO,CAAC,SAAS;IAuBjB;;OAEG;IACH,OAAO,CAAC,YAAY;IAqBpB;;OAEG;IACH,OAAO,CAAC,aAAa;CAQxB;AAED;;GAEG;AACH,wBAAgB,4BAA4B,SAE3C"}
|
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LoadCreateSVGWordCloudAction = exports.CreateSVGWordCloudAction = void 0;
|
|
13
|
+
const actions_1 = require("@memberjunction/actions");
|
|
14
|
+
const global_1 = require("@memberjunction/global");
|
|
15
|
+
const d3_cloud_1 = __importDefault(require("d3-cloud"));
|
|
16
|
+
const svg_utils_1 = require("./shared/svg-utils");
|
|
17
|
+
const svg_theming_1 = require("./shared/svg-theming");
|
|
18
|
+
// Handle d3-cloud module export
|
|
19
|
+
const d3Cloud = d3_cloud_1.default.default || d3_cloud_1.default;
|
|
20
|
+
/**
|
|
21
|
+
* Action that generates SVG word clouds and tag bars from weighted word lists.
|
|
22
|
+
*
|
|
23
|
+
* This action provides server-side SVG generation for text visualizations, designed for
|
|
24
|
+
* AI agents and workflows to create publication-quality word clouds from data.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* // Word cloud example
|
|
29
|
+
* await runAction({
|
|
30
|
+
* ActionName: 'Create SVG Word Cloud',
|
|
31
|
+
* Params: [
|
|
32
|
+
* { Name: 'CloudType', Value: 'cloud' },
|
|
33
|
+
* { Name: 'Words', Value: JSON.stringify([
|
|
34
|
+
* { text: 'TypeScript', weight: 100 },
|
|
35
|
+
* { text: 'JavaScript', weight: 80 },
|
|
36
|
+
* { text: 'React', weight: 60 },
|
|
37
|
+
* { text: 'Node.js', weight: 50 }
|
|
38
|
+
* ]) },
|
|
39
|
+
* { Name: 'MaxWords', Value: '50' },
|
|
40
|
+
* { Name: 'Rotation', Value: 'few' },
|
|
41
|
+
* { Name: 'Width', Value: '800' },
|
|
42
|
+
* { Name: 'Height', Value: '600' }
|
|
43
|
+
* ]
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // Tag bar example
|
|
47
|
+
* await runAction({
|
|
48
|
+
* ActionName: 'Create SVG Word Cloud',
|
|
49
|
+
* Params: [
|
|
50
|
+
* { Name: 'CloudType', Value: 'tagbar' },
|
|
51
|
+
* { Name: 'Words', Value: JSON.stringify([
|
|
52
|
+
* { text: 'AI', weight: 67 },
|
|
53
|
+
* { text: 'Data', weight: 45 },
|
|
54
|
+
* { text: 'API', weight: 32 }
|
|
55
|
+
* ]) },
|
|
56
|
+
* { Name: 'MaxWords', Value: '10' }
|
|
57
|
+
* ]
|
|
58
|
+
* });
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
let CreateSVGWordCloudAction = class CreateSVGWordCloudAction extends actions_1.BaseAction {
|
|
62
|
+
/**
|
|
63
|
+
* Generates an SVG word cloud from the provided data and configuration
|
|
64
|
+
*
|
|
65
|
+
* @param params - The action parameters containing:
|
|
66
|
+
* - CloudType: Type of visualization ('cloud' | 'tagbar')
|
|
67
|
+
* - Words: JSON array of {text, weight} objects
|
|
68
|
+
* - MaxWords: Maximum number of words to display (default: 50)
|
|
69
|
+
* - Rotation: Rotation strategy ('none' | 'few' | 'mixed') for clouds
|
|
70
|
+
* - MinFont: Minimum font size (default: 10)
|
|
71
|
+
* - MaxFont: Maximum font size (default: 80)
|
|
72
|
+
* - Seed: Random seed for deterministic layouts (optional)
|
|
73
|
+
* - Width: Width in pixels (optional, default: 800)
|
|
74
|
+
* - Height: Height in pixels (optional, default: 600)
|
|
75
|
+
* - Title: Visualization title (optional)
|
|
76
|
+
* - Palette: Color palette name (optional)
|
|
77
|
+
*
|
|
78
|
+
* @returns A promise resolving to an SVGActionResult
|
|
79
|
+
*/
|
|
80
|
+
async InternalRunAction(params) {
|
|
81
|
+
try {
|
|
82
|
+
const cloudTypeParam = this.getParamValue(params, 'CloudType');
|
|
83
|
+
const cloudType = cloudTypeParam ? this.ensureString(cloudTypeParam, 'CloudType').toLowerCase() : 'cloud';
|
|
84
|
+
if (!['cloud', 'tagbar'].includes(cloudType)) {
|
|
85
|
+
return {
|
|
86
|
+
Success: false,
|
|
87
|
+
Message: 'CloudType must be "cloud" or "tagbar"',
|
|
88
|
+
ResultCode: 'INVALID_CLOUD_TYPE',
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
// Parse words
|
|
92
|
+
const wordsParam = this.getParamValue(params, 'Words');
|
|
93
|
+
if (!wordsParam) {
|
|
94
|
+
return {
|
|
95
|
+
Success: false,
|
|
96
|
+
Message: 'Words parameter is required',
|
|
97
|
+
ResultCode: 'MISSING_PARAMETERS',
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
let words = this.parseJSON(wordsParam, 'Words');
|
|
101
|
+
// Parse common parameters
|
|
102
|
+
const maxWords = parseInt(this.ensureString(this.getParamValue(params, 'MaxWords') || '50', 'MaxWords'));
|
|
103
|
+
const width = parseInt(this.ensureString(this.getParamValue(params, 'Width') || '800', 'Width'));
|
|
104
|
+
const height = parseInt(this.ensureString(this.getParamValue(params, 'Height') || '600', 'Height'));
|
|
105
|
+
const title = this.ensureString(this.getParamValue(params, 'Title') || '', 'Title');
|
|
106
|
+
const paletteName = this.ensureString(this.getParamValue(params, 'Palette') || 'mjDefault', 'Palette');
|
|
107
|
+
const seed = parseInt(this.ensureString(this.getParamValue(params, 'Seed') || String(Date.now()), 'Seed'));
|
|
108
|
+
// Sort by weight descending and limit
|
|
109
|
+
words = words.sort((a, b) => b.weight - a.weight).slice(0, maxWords);
|
|
110
|
+
// Create branding configuration
|
|
111
|
+
const branding = {
|
|
112
|
+
palette: { type: 'named', name: paletteName },
|
|
113
|
+
};
|
|
114
|
+
// Create viewBox configuration
|
|
115
|
+
const viewBox = {
|
|
116
|
+
width,
|
|
117
|
+
height,
|
|
118
|
+
padding: 20,
|
|
119
|
+
};
|
|
120
|
+
// Generate visualization based on type
|
|
121
|
+
let svg;
|
|
122
|
+
const warnings = [];
|
|
123
|
+
switch (cloudType) {
|
|
124
|
+
case 'cloud':
|
|
125
|
+
svg = await this.renderWordCloud(params, words, viewBox, branding, title, seed, warnings);
|
|
126
|
+
break;
|
|
127
|
+
case 'tagbar':
|
|
128
|
+
svg = await this.renderTagBar(words, viewBox, branding, title);
|
|
129
|
+
break;
|
|
130
|
+
default:
|
|
131
|
+
return {
|
|
132
|
+
Success: false,
|
|
133
|
+
Message: `Unsupported cloud type: ${cloudType}`,
|
|
134
|
+
ResultCode: 'INVALID_CLOUD_TYPE',
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
Success: true,
|
|
139
|
+
ResultCode: 'SUCCESS',
|
|
140
|
+
Message: svg,
|
|
141
|
+
svg,
|
|
142
|
+
width,
|
|
143
|
+
height,
|
|
144
|
+
warnings: warnings.length > 0 ? warnings : undefined,
|
|
145
|
+
diagnostics: {
|
|
146
|
+
wordCount: words.length,
|
|
147
|
+
requestedMaxWords: maxWords,
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
return {
|
|
153
|
+
Success: false,
|
|
154
|
+
Message: `Failed to generate word cloud: ${error instanceof Error ? error.message : String(error)}`,
|
|
155
|
+
ResultCode: 'WORD_CLOUD_GENERATION_FAILED',
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Renders a word cloud using d3-cloud
|
|
161
|
+
*/
|
|
162
|
+
async renderWordCloud(params, words, viewBox, branding, title, seed, warnings) {
|
|
163
|
+
try {
|
|
164
|
+
// Parse cloud-specific parameters
|
|
165
|
+
const rotation = this.getParamValue(params, 'Rotation') || 'few';
|
|
166
|
+
const minFont = parseInt(this.getParamValue(params, 'MinFont') || '10');
|
|
167
|
+
const maxFont = parseInt(this.getParamValue(params, 'MaxFont') || '80');
|
|
168
|
+
// Calculate viewBox
|
|
169
|
+
const vb = svg_utils_1.SVGUtils.calculateViewBox(viewBox);
|
|
170
|
+
// Create seeded random generator
|
|
171
|
+
const random = svg_utils_1.SVGUtils.seededRandom(seed);
|
|
172
|
+
// Calculate font sizes using log scale
|
|
173
|
+
const minWeight = Math.min(...words.map((w) => w.weight));
|
|
174
|
+
const maxWeight = Math.max(...words.map((w) => w.weight));
|
|
175
|
+
const logMin = Math.log(minWeight || 1);
|
|
176
|
+
const logMax = Math.log(maxWeight || 1);
|
|
177
|
+
const wordsWithSize = words.map((w) => {
|
|
178
|
+
const logWeight = Math.log(w.weight || 1);
|
|
179
|
+
const normalizedSize = logMax > logMin ? (logWeight - logMin) / (logMax - logMin) : 0.5;
|
|
180
|
+
const fontSize = minFont + normalizedSize * (maxFont - minFont);
|
|
181
|
+
return {
|
|
182
|
+
text: w.text,
|
|
183
|
+
size: fontSize,
|
|
184
|
+
weight: w.weight,
|
|
185
|
+
};
|
|
186
|
+
});
|
|
187
|
+
// Determine rotation angles based on strategy
|
|
188
|
+
const getRotation = () => {
|
|
189
|
+
switch (rotation) {
|
|
190
|
+
case 'none':
|
|
191
|
+
return 0;
|
|
192
|
+
case 'few':
|
|
193
|
+
return random() < 0.5 ? 0 : -90;
|
|
194
|
+
case 'mixed':
|
|
195
|
+
return Math.floor(random() * 4) * 45 - 90;
|
|
196
|
+
default:
|
|
197
|
+
return 0;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
// Create d3-cloud layout
|
|
201
|
+
return new Promise((resolve, reject) => {
|
|
202
|
+
try {
|
|
203
|
+
const layout = d3Cloud()
|
|
204
|
+
.size([vb.contentWidth, vb.contentHeight])
|
|
205
|
+
.words(wordsWithSize)
|
|
206
|
+
.padding(5)
|
|
207
|
+
.rotate(getRotation)
|
|
208
|
+
.font((0, svg_theming_1.getFontSpec)(branding.font).family)
|
|
209
|
+
.fontSize((d) => d.size)
|
|
210
|
+
.random(random)
|
|
211
|
+
.spiral('archimedean')
|
|
212
|
+
.on('end', (layoutWords) => {
|
|
213
|
+
try {
|
|
214
|
+
// Check if any words didn't fit
|
|
215
|
+
const fittedWords = layoutWords.filter((w) => w.x != null && w.y != null);
|
|
216
|
+
if (fittedWords.length < wordsWithSize.length) {
|
|
217
|
+
warnings.push(`${wordsWithSize.length - fittedWords.length} words did not fit in the layout`);
|
|
218
|
+
}
|
|
219
|
+
// Create SVG - STEP 1
|
|
220
|
+
let doc;
|
|
221
|
+
try {
|
|
222
|
+
doc = svg_utils_1.SVGUtils.createSVG(viewBox.width, viewBox.height, 'wordcloud');
|
|
223
|
+
}
|
|
224
|
+
catch (error) {
|
|
225
|
+
throw new Error(`[STEP 1: createSVG] ${error instanceof Error ? error.message : String(error)}\nStack: ${error instanceof Error ? error.stack : 'N/A'}`);
|
|
226
|
+
}
|
|
227
|
+
// Get SVG element - STEP 2
|
|
228
|
+
let svg;
|
|
229
|
+
try {
|
|
230
|
+
svg = doc.querySelector('svg');
|
|
231
|
+
if (!svg) {
|
|
232
|
+
throw new Error('SVG element not found in document');
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
throw new Error(`[STEP 2: querySelector] ${error instanceof Error ? error.message : String(error)}\nStack: ${error instanceof Error ? error.stack : 'N/A'}`);
|
|
237
|
+
}
|
|
238
|
+
// Add accessibility - STEP 3
|
|
239
|
+
if (title) {
|
|
240
|
+
try {
|
|
241
|
+
svg_utils_1.SVGUtils.addA11y(svg, {
|
|
242
|
+
title,
|
|
243
|
+
ariaRole: 'img',
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
throw new Error(`[STEP 3: addA11y] ${error instanceof Error ? error.message : String(error)}\nStack: ${error instanceof Error ? error.stack : 'N/A'}`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
// Add styles - STEP 4
|
|
251
|
+
try {
|
|
252
|
+
const css = (0, svg_theming_1.generateCSS)(branding);
|
|
253
|
+
svg_utils_1.SVGUtils.addStyles(svg, css);
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
throw new Error(`[STEP 4: addStyles] ${error instanceof Error ? error.message : String(error)}\nStack: ${error instanceof Error ? error.stack : 'N/A'}`);
|
|
257
|
+
}
|
|
258
|
+
// Get palette - STEP 5
|
|
259
|
+
let palette;
|
|
260
|
+
try {
|
|
261
|
+
palette = (0, svg_theming_1.getPalette)(branding.palette);
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
throw new Error(`[STEP 5: getPalette] ${error instanceof Error ? error.message : String(error)}\nStack: ${error instanceof Error ? error.stack : 'N/A'}`);
|
|
265
|
+
}
|
|
266
|
+
// Create container group - STEP 6
|
|
267
|
+
try {
|
|
268
|
+
const ns = svg.namespaceURI;
|
|
269
|
+
if (!ns) {
|
|
270
|
+
throw new Error('SVG namespaceURI is null');
|
|
271
|
+
}
|
|
272
|
+
const container = doc.createElementNS(ns, 'g');
|
|
273
|
+
container.setAttribute('transform', `translate(${vb.x + vb.contentWidth / 2}, ${vb.y + vb.contentHeight / 2})`);
|
|
274
|
+
svg.appendChild(container);
|
|
275
|
+
// Render words - STEP 7
|
|
276
|
+
fittedWords.forEach((word, i) => {
|
|
277
|
+
try {
|
|
278
|
+
const text = doc.createElementNS(ns, 'text');
|
|
279
|
+
text.setAttribute('transform', `translate(${word.x || 0}, ${word.y || 0}) rotate(${word.rotate || 0})`);
|
|
280
|
+
text.setAttribute('font-family', (0, svg_theming_1.getFontSpec)(branding.font).family);
|
|
281
|
+
text.setAttribute('font-size', String(word.size));
|
|
282
|
+
text.setAttribute('text-anchor', 'middle');
|
|
283
|
+
text.setAttribute('font-weight', String(word.size > 40 ? 'bold' : 'normal'));
|
|
284
|
+
// Get color from palette
|
|
285
|
+
const color = (0, svg_theming_1.getColorForIndex)(i, branding.palette);
|
|
286
|
+
text.setAttribute('fill', color);
|
|
287
|
+
// Add subtle stroke for better visibility
|
|
288
|
+
if (word.size > 30) {
|
|
289
|
+
text.setAttribute('stroke', palette.background);
|
|
290
|
+
text.setAttribute('stroke-width', '0.5');
|
|
291
|
+
text.setAttribute('paint-order', 'stroke fill');
|
|
292
|
+
}
|
|
293
|
+
text.textContent = word.text;
|
|
294
|
+
container.appendChild(text);
|
|
295
|
+
}
|
|
296
|
+
catch (error) {
|
|
297
|
+
throw new Error(`[STEP 7: render word ${i} "${word.text}"] ${error instanceof Error ? error.message : String(error)}\nStack: ${error instanceof Error ? error.stack : 'N/A'}`);
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
catch (error) {
|
|
302
|
+
throw new Error(`[STEP 6: create container] ${error instanceof Error ? error.message : String(error)}\nStack: ${error instanceof Error ? error.stack : 'N/A'}`);
|
|
303
|
+
}
|
|
304
|
+
// Add title if present - STEP 8
|
|
305
|
+
if (title) {
|
|
306
|
+
try {
|
|
307
|
+
this.addTitle(doc, svg, title, vb.width, (0, svg_theming_1.getFontSpec)(branding.font));
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
throw new Error(`[STEP 8: addTitle] ${error instanceof Error ? error.message : String(error)}\nStack: ${error instanceof Error ? error.stack : 'N/A'}`);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
// Sanitize and resolve - STEP 9
|
|
314
|
+
try {
|
|
315
|
+
const result = svg_utils_1.SVGUtils.sanitizeSVG(svg.outerHTML);
|
|
316
|
+
resolve(result);
|
|
317
|
+
}
|
|
318
|
+
catch (error) {
|
|
319
|
+
throw new Error(`[STEP 9: sanitizeSVG] ${error instanceof Error ? error.message : String(error)}\nStack: ${error instanceof Error ? error.stack : 'N/A'}`);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
catch (error) {
|
|
323
|
+
reject(error);
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
layout.start();
|
|
327
|
+
}
|
|
328
|
+
catch (error) {
|
|
329
|
+
reject(new Error(`[d3-cloud layout setup] ${error instanceof Error ? error.message : String(error)}\nStack: ${error instanceof Error ? error.stack : 'N/A'}`));
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
catch (error) {
|
|
334
|
+
throw new Error(`[renderWordCloud outer] ${error instanceof Error ? error.message : String(error)}\nStack: ${error instanceof Error ? error.stack : 'N/A'}`);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Renders a tag bar visualization
|
|
339
|
+
*/
|
|
340
|
+
async renderTagBar(words, viewBox, branding, title) {
|
|
341
|
+
// Calculate viewBox
|
|
342
|
+
const vb = svg_utils_1.SVGUtils.calculateViewBox(viewBox);
|
|
343
|
+
// Create SVG
|
|
344
|
+
const doc = svg_utils_1.SVGUtils.createSVG(viewBox.width, viewBox.height, 'tagbar');
|
|
345
|
+
const svg = doc.querySelector('svg');
|
|
346
|
+
// Add accessibility
|
|
347
|
+
if (title) {
|
|
348
|
+
svg_utils_1.SVGUtils.addA11y(svg, {
|
|
349
|
+
title,
|
|
350
|
+
ariaRole: 'img',
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
// Add styles
|
|
354
|
+
const css = (0, svg_theming_1.generateCSS)(branding);
|
|
355
|
+
svg_utils_1.SVGUtils.addStyles(svg, css);
|
|
356
|
+
// Get palette
|
|
357
|
+
const palette = (0, svg_theming_1.getPalette)(branding.palette);
|
|
358
|
+
const font = (0, svg_theming_1.getFontSpec)(branding.font);
|
|
359
|
+
// Calculate bar dimensions
|
|
360
|
+
const barHeight = 40;
|
|
361
|
+
const spacing = 10;
|
|
362
|
+
const availableHeight = vb.contentHeight - (title ? 40 : 0);
|
|
363
|
+
const maxBars = Math.floor(availableHeight / (barHeight + spacing));
|
|
364
|
+
const displayWords = words.slice(0, maxBars);
|
|
365
|
+
// Normalize bar widths based on weights
|
|
366
|
+
const maxWeight = Math.max(...displayWords.map((w) => w.weight));
|
|
367
|
+
const minBarWidth = 100;
|
|
368
|
+
// Create container group
|
|
369
|
+
const ns = svg.namespaceURI;
|
|
370
|
+
const container = doc.createElementNS(ns, 'g');
|
|
371
|
+
container.setAttribute('transform', `translate(${vb.x}, ${vb.y + (title ? 40 : 0)})`);
|
|
372
|
+
svg.appendChild(container);
|
|
373
|
+
// Render bars
|
|
374
|
+
displayWords.forEach((word, i) => {
|
|
375
|
+
const yPos = i * (barHeight + spacing);
|
|
376
|
+
const barWidth = minBarWidth + ((word.weight / maxWeight) * (vb.contentWidth - minBarWidth));
|
|
377
|
+
const g = doc.createElementNS(ns, 'g');
|
|
378
|
+
g.setAttribute('transform', `translate(0, ${yPos})`);
|
|
379
|
+
// Bar rectangle
|
|
380
|
+
const rect = doc.createElementNS(ns, 'rect');
|
|
381
|
+
rect.setAttribute('x', '0');
|
|
382
|
+
rect.setAttribute('y', '0');
|
|
383
|
+
rect.setAttribute('width', String(barWidth));
|
|
384
|
+
rect.setAttribute('height', String(barHeight));
|
|
385
|
+
rect.setAttribute('fill', (0, svg_theming_1.getColorForIndex)(i, branding.palette));
|
|
386
|
+
rect.setAttribute('rx', '5');
|
|
387
|
+
g.appendChild(rect);
|
|
388
|
+
// Label text
|
|
389
|
+
const text = doc.createElementNS(ns, 'text');
|
|
390
|
+
text.setAttribute('x', '10');
|
|
391
|
+
text.setAttribute('y', String(barHeight / 2));
|
|
392
|
+
text.setAttribute('dominant-baseline', 'middle');
|
|
393
|
+
text.setAttribute('font-family', font.family);
|
|
394
|
+
text.setAttribute('font-size', String(font.size));
|
|
395
|
+
text.setAttribute('font-weight', 'bold');
|
|
396
|
+
text.setAttribute('fill', '#FFF');
|
|
397
|
+
text.textContent = word.text;
|
|
398
|
+
g.appendChild(text);
|
|
399
|
+
// Weight text
|
|
400
|
+
const weightText = doc.createElementNS(ns, 'text');
|
|
401
|
+
weightText.setAttribute('x', String(barWidth - 10));
|
|
402
|
+
weightText.setAttribute('y', String(barHeight / 2));
|
|
403
|
+
weightText.setAttribute('text-anchor', 'end');
|
|
404
|
+
weightText.setAttribute('dominant-baseline', 'middle');
|
|
405
|
+
weightText.setAttribute('font-family', font.family);
|
|
406
|
+
weightText.setAttribute('font-size', String(font.size - 2));
|
|
407
|
+
weightText.setAttribute('fill', '#FFF');
|
|
408
|
+
weightText.setAttribute('opacity', '0.9');
|
|
409
|
+
weightText.textContent = String(word.weight);
|
|
410
|
+
g.appendChild(weightText);
|
|
411
|
+
container.appendChild(g);
|
|
412
|
+
});
|
|
413
|
+
// Add title if present
|
|
414
|
+
if (title) {
|
|
415
|
+
this.addTitle(doc, svg, title, vb.width, font);
|
|
416
|
+
}
|
|
417
|
+
// Sanitize and return
|
|
418
|
+
return svg_utils_1.SVGUtils.sanitizeSVG(svg.outerHTML);
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Adds a title to the SVG
|
|
422
|
+
*/
|
|
423
|
+
addTitle(doc, svg, title, width, font) {
|
|
424
|
+
const ns = svg.namespaceURI;
|
|
425
|
+
const text = doc.createElementNS(ns, 'text');
|
|
426
|
+
text.setAttribute('x', String(width / 2));
|
|
427
|
+
text.setAttribute('y', '25');
|
|
428
|
+
text.setAttribute('text-anchor', 'middle');
|
|
429
|
+
text.setAttribute('font-family', font.family);
|
|
430
|
+
text.setAttribute('font-size', String(font.size + 4));
|
|
431
|
+
text.setAttribute('font-weight', 'bold');
|
|
432
|
+
text.textContent = title;
|
|
433
|
+
svg.appendChild(text);
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Helper to safely parse JSON that might already be an object
|
|
437
|
+
*/
|
|
438
|
+
parseJSON(value, paramName) {
|
|
439
|
+
// If it's already an object/array, return it
|
|
440
|
+
if (typeof value === 'object' && value !== null) {
|
|
441
|
+
return value;
|
|
442
|
+
}
|
|
443
|
+
// If it's a string, parse it
|
|
444
|
+
if (typeof value === 'string') {
|
|
445
|
+
try {
|
|
446
|
+
return JSON.parse(value);
|
|
447
|
+
}
|
|
448
|
+
catch (error) {
|
|
449
|
+
throw new Error(`Parameter '${paramName}' contains invalid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
// For other types, error
|
|
453
|
+
throw new Error(`Parameter '${paramName}' must be a JSON string or object. Received ${typeof value}.`);
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Helper to ensure a parameter value is a string, with type conversion and validation
|
|
457
|
+
*/
|
|
458
|
+
ensureString(value, paramName) {
|
|
459
|
+
if (value == null) {
|
|
460
|
+
return '';
|
|
461
|
+
}
|
|
462
|
+
if (typeof value === 'string') {
|
|
463
|
+
return value;
|
|
464
|
+
}
|
|
465
|
+
// Convert numbers and booleans to strings
|
|
466
|
+
if (typeof value === 'number' || typeof value === 'boolean') {
|
|
467
|
+
return String(value);
|
|
468
|
+
}
|
|
469
|
+
// For objects/arrays, reject with descriptive error
|
|
470
|
+
throw new Error(`Parameter '${paramName}' must be a string, number, or boolean. ` +
|
|
471
|
+
`Received ${typeof value}. If providing JSON data, ensure it's passed as a string.`);
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* Helper to get parameter value by name (case-insensitive)
|
|
475
|
+
*/
|
|
476
|
+
getParamValue(params, paramName) {
|
|
477
|
+
const param = params.Params.find((p) => p.Name.trim().toLowerCase() === paramName.toLowerCase());
|
|
478
|
+
if (param?.Value && typeof param.Value === 'string') {
|
|
479
|
+
return param?.Value?.trim() || null;
|
|
480
|
+
}
|
|
481
|
+
else {
|
|
482
|
+
return param?.Value || null;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
exports.CreateSVGWordCloudAction = CreateSVGWordCloudAction;
|
|
487
|
+
exports.CreateSVGWordCloudAction = CreateSVGWordCloudAction = __decorate([
|
|
488
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, '__CreateSVGWordCloud')
|
|
489
|
+
], CreateSVGWordCloudAction);
|
|
490
|
+
/**
|
|
491
|
+
* Loader function to ensure the CreateSVGWordCloudAction class is included in the bundle.
|
|
492
|
+
*/
|
|
493
|
+
function LoadCreateSVGWordCloudAction() {
|
|
494
|
+
// this function is a stub that is used to force the bundler to include the above class in the final bundle and not tree shake them out
|
|
495
|
+
}
|
|
496
|
+
exports.LoadCreateSVGWordCloudAction = LoadCreateSVGWordCloudAction;
|
|
497
|
+
//# sourceMappingURL=create-svg-word-cloud.action.js.map
|