@finos/legend-lego 2.0.211 → 2.0.213
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.css +2 -2
- package/lib/index.css.map +1 -1
- package/lib/legend-ai/LegendAIDocEnrichment.d.ts +12 -12
- package/lib/legend-ai/LegendAIDocEnrichment.d.ts.map +1 -1
- package/lib/legend-ai/LegendAIDocEnrichment.js +317 -86
- package/lib/legend-ai/LegendAIDocEnrichment.js.map +1 -1
- package/lib/legend-ai/LegendAIHostIntegration.d.ts +31 -0
- package/lib/legend-ai/LegendAIHostIntegration.d.ts.map +1 -0
- package/lib/legend-ai/LegendAIHostIntegration.js +50 -0
- package/lib/legend-ai/LegendAIHostIntegration.js.map +1 -0
- package/lib/legend-ai/LegendAIServiceRetrieval.d.ts.map +1 -1
- package/lib/legend-ai/LegendAIServiceRetrieval.js +34 -35
- package/lib/legend-ai/LegendAIServiceRetrieval.js.map +1 -1
- package/lib/legend-ai/LegendAITypes.d.ts +85 -7
- package/lib/legend-ai/LegendAITypes.d.ts.map +1 -1
- package/lib/legend-ai/LegendAITypes.js +99 -1
- package/lib/legend-ai/LegendAITypes.js.map +1 -1
- package/lib/legend-ai/LegendAI_LegendApplicationPlugin_Extension.d.ts +36 -3
- package/lib/legend-ai/LegendAI_LegendApplicationPlugin_Extension.d.ts.map +1 -1
- package/lib/legend-ai/LegendAI_LegendApplicationPlugin_Extension.js +29 -0
- package/lib/legend-ai/LegendAI_LegendApplicationPlugin_Extension.js.map +1 -1
- package/lib/legend-ai/__test-utils__/LegendAITestUtils.d.ts.map +1 -1
- package/lib/legend-ai/__test-utils__/LegendAITestUtils.js +7 -0
- package/lib/legend-ai/__test-utils__/LegendAITestUtils.js.map +1 -1
- package/lib/legend-ai/components/LegendAICharts.d.ts.map +1 -1
- package/lib/legend-ai/components/LegendAICharts.js +6 -10
- package/lib/legend-ai/components/LegendAICharts.js.map +1 -1
- package/lib/legend-ai/components/LegendAIChat.d.ts.map +1 -1
- package/lib/legend-ai/components/LegendAIChat.js +263 -41
- package/lib/legend-ai/components/LegendAIChat.js.map +1 -1
- package/lib/legend-ai/components/LegendAIChatInput.d.ts +1 -1
- package/lib/legend-ai/components/LegendAIChatInput.d.ts.map +1 -1
- package/lib/legend-ai/components/LegendAIChatInput.js +2 -1
- package/lib/legend-ai/components/LegendAIChatInput.js.map +1 -1
- package/lib/legend-ai/index.d.ts +5 -2
- package/lib/legend-ai/index.d.ts.map +1 -1
- package/lib/legend-ai/index.js +5 -2
- package/lib/legend-ai/index.js.map +1 -1
- package/lib/legend-ai/stores/LegendAIChatProcessors.d.ts +9 -3
- package/lib/legend-ai/stores/LegendAIChatProcessors.d.ts.map +1 -1
- package/lib/legend-ai/stores/LegendAIChatProcessors.js +794 -220
- package/lib/legend-ai/stores/LegendAIChatProcessors.js.map +1 -1
- package/lib/legend-ai/stores/LegendAIChatState.d.ts.map +1 -1
- package/lib/legend-ai/stores/LegendAIChatState.js +47 -21
- package/lib/legend-ai/stores/LegendAIChatState.js.map +1 -1
- package/lib/legend-ai/stores/LegendAIJoinAnalysis.d.ts +29 -0
- package/lib/legend-ai/stores/LegendAIJoinAnalysis.d.ts.map +1 -0
- package/lib/legend-ai/stores/LegendAIJoinAnalysis.js +124 -0
- package/lib/legend-ai/stores/LegendAIJoinAnalysis.js.map +1 -0
- package/lib/legend-ai/stores/LegendAISqlHelpers.d.ts +25 -0
- package/lib/legend-ai/stores/LegendAISqlHelpers.d.ts.map +1 -0
- package/lib/legend-ai/stores/LegendAISqlHelpers.js +64 -0
- package/lib/legend-ai/stores/LegendAISqlHelpers.js.map +1 -0
- package/lib/legend-ai/stores/LegendAISqlJoinSanitizers.d.ts +22 -0
- package/lib/legend-ai/stores/LegendAISqlJoinSanitizers.d.ts.map +1 -0
- package/lib/legend-ai/stores/LegendAISqlJoinSanitizers.js +411 -0
- package/lib/legend-ai/stores/LegendAISqlJoinSanitizers.js.map +1 -0
- package/package.json +6 -6
- package/src/legend-ai/LegendAIDocEnrichment.ts +435 -97
- package/src/legend-ai/LegendAIHostIntegration.tsx +80 -0
- package/src/legend-ai/LegendAIServiceRetrieval.ts +50 -35
- package/src/legend-ai/LegendAITypes.ts +169 -5
- package/src/legend-ai/LegendAI_LegendApplicationPlugin_Extension.ts +73 -1
- package/src/legend-ai/__test-utils__/LegendAITestUtils.ts +10 -0
- package/src/legend-ai/components/LegendAICharts.tsx +30 -33
- package/src/legend-ai/components/LegendAIChat.tsx +555 -91
- package/src/legend-ai/components/LegendAIChatInput.tsx +6 -2
- package/src/legend-ai/index.ts +22 -3
- package/src/legend-ai/stores/LegendAIChatProcessors.ts +1286 -322
- package/src/legend-ai/stores/LegendAIChatState.ts +73 -28
- package/src/legend-ai/stores/LegendAIJoinAnalysis.ts +165 -0
- package/src/legend-ai/stores/LegendAISqlHelpers.ts +82 -0
- package/src/legend-ai/stores/LegendAISqlJoinSanitizers.ts +515 -0
- package/tsconfig.json +4 -0
|
@@ -170,6 +170,7 @@ export const LegendAIDonutChart = (props: {
|
|
|
170
170
|
const LINE_SVG_WIDTH = 400;
|
|
171
171
|
const LINE_SVG_HEIGHT = 180;
|
|
172
172
|
const LINE_PADDING = { top: 16, right: 16, bottom: 28, left: 52 };
|
|
173
|
+
const AXIS_LABEL_MAX_CHARS = 10;
|
|
173
174
|
|
|
174
175
|
export const LegendAILineChart = (props: {
|
|
175
176
|
data: LegendAIChartDataPoint[];
|
|
@@ -203,7 +204,7 @@ export const LegendAILineChart = (props: {
|
|
|
203
204
|
LINE_PADDING.left +
|
|
204
205
|
(data.length > 1 ? (i / (data.length - 1)) * plotW : plotW / 2);
|
|
205
206
|
const y = LINE_PADDING.top + (1 - (d.value - lo) / range) * plotH;
|
|
206
|
-
return { x, y,
|
|
207
|
+
return { x, y, label: d.label, value: d.value };
|
|
207
208
|
});
|
|
208
209
|
return {
|
|
209
210
|
points: pts,
|
|
@@ -219,6 +220,10 @@ export const LegendAILineChart = (props: {
|
|
|
219
220
|
|
|
220
221
|
const plotBottom = LINE_SVG_HEIGHT - LINE_PADDING.bottom;
|
|
221
222
|
const color = getChartColor(0);
|
|
223
|
+
const firstPt = points[0];
|
|
224
|
+
const lastPt = points[points.length - 1];
|
|
225
|
+
const axisEndpoints =
|
|
226
|
+
firstPt && lastPt ? { first: firstPt, last: lastPt } : undefined;
|
|
222
227
|
|
|
223
228
|
return (
|
|
224
229
|
<div className="legend-ai-chart legend-ai-chart--line">
|
|
@@ -280,7 +285,7 @@ export const LegendAILineChart = (props: {
|
|
|
280
285
|
{/* Dots */}
|
|
281
286
|
{points.map((p) => (
|
|
282
287
|
<circle
|
|
283
|
-
key={`${p.
|
|
288
|
+
key={`${p.x}-${p.y}`}
|
|
284
289
|
cx={p.x}
|
|
285
290
|
cy={p.y}
|
|
286
291
|
r={3}
|
|
@@ -289,37 +294,29 @@ export const LegendAILineChart = (props: {
|
|
|
289
294
|
/>
|
|
290
295
|
))}
|
|
291
296
|
|
|
292
|
-
{/* X-axis labels (first,
|
|
293
|
-
{
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
{
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
textAnchor="end"
|
|
316
|
-
>
|
|
317
|
-
{lastPt.label.slice(0, 10)}
|
|
318
|
-
</text>
|
|
319
|
-
)}
|
|
320
|
-
</>
|
|
321
|
-
);
|
|
322
|
-
})()}
|
|
297
|
+
{/* X-axis labels (first, last) */}
|
|
298
|
+
{axisEndpoints && (
|
|
299
|
+
<>
|
|
300
|
+
<text
|
|
301
|
+
x={axisEndpoints.first.x}
|
|
302
|
+
y={plotBottom + 16}
|
|
303
|
+
className="legend-ai-chart__axis-label"
|
|
304
|
+
textAnchor="start"
|
|
305
|
+
>
|
|
306
|
+
{axisEndpoints.first.label.slice(0, AXIS_LABEL_MAX_CHARS)}
|
|
307
|
+
</text>
|
|
308
|
+
{points.length > 2 && (
|
|
309
|
+
<text
|
|
310
|
+
x={axisEndpoints.last.x}
|
|
311
|
+
y={plotBottom + 16}
|
|
312
|
+
className="legend-ai-chart__axis-label"
|
|
313
|
+
textAnchor="end"
|
|
314
|
+
>
|
|
315
|
+
{axisEndpoints.last.label.slice(0, AXIS_LABEL_MAX_CHARS)}
|
|
316
|
+
</text>
|
|
317
|
+
)}
|
|
318
|
+
</>
|
|
319
|
+
)}
|
|
323
320
|
</svg>
|
|
324
321
|
</div>
|
|
325
322
|
);
|