Member Junction
    Preparing search index...

    Action that generates SVG charts from data using D3. Supports bar, line, pie, scatter, and area charts.

    This action is designed for AI agents and workflows to create publication-quality visualizations from structured data without writing visualization code.

    // Simple bar chart
    await runAction({
    ActionName: 'Create SVG Chart',
    Params: [
    { Name: 'ChartType', Value: 'bar' },
    { Name: 'Data', Value: JSON.stringify([
    { label: 'A', value: 28 },
    { label: 'B', value: 55 },
    { label: 'C', value: 43 }
    ]) },
    { Name: 'Title', Value: 'Sample Bar Chart' }
    ]
    });

    // Line chart with X/Y data
    await runAction({
    ActionName: 'Create SVG Chart',
    Params: [
    { Name: 'ChartType', Value: 'line' },
    { Name: 'Data', Value: JSON.stringify([
    { x: 1, y: 10 },
    { x: 2, y: 25 },
    { x: 3, y: 15 }
    ]) }
    ]
    });

    // Pie chart
    await runAction({
    ActionName: 'Create SVG Chart',
    Params: [
    { Name: 'ChartType', Value: 'pie' },
    { Name: 'Data', Value: JSON.stringify([
    { label: 'LLM', value: 67 },
    { label: 'Embeddings', value: 10 }
    ]) }
    ]
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    AuthorizesCaller: boolean

    True when the action authorizes its caller itself, so a public entry point such as the RunAction mutation may run it for an authenticated user without an MJ: Action Authorizations link. Set it only on an action that either checks an authorization the caller must hold, or reads and writes only with the caller's own permissions. Leave it false for an action that acts with more authority than its caller, or that reaches data or sends messages the caller chooses but could not otherwise reach.

    The engine reads the marker only from the class that runs, never from its parent classes. A subclass that overrides a marked action must declare the marker again.

    Methods

    • Generates an SVG chart from the provided data and configuration

      Parameters

      • params: RunActionParams

        The action parameters containing:

        • ChartType: Type of chart (bar, line, pie, scatter, area)
        • Data: JSON array of data objects
        • Title: Chart title (optional)
        • XAxisLabel: X-axis label (optional)
        • YAxisLabel: Y-axis label (optional)
        • Width: Chart width in pixels (optional, default: 800)
        • Height: Chart height in pixels (optional, default: 600)
        • Palette: Color palette name (optional, default: 'mjDefault')
        • ShowGrid: Show grid lines (optional, default: false)
        • ShowLegend: Show legend (optional, default: false)

      Returns Promise<SVGActionResult>

      A promise resolving to an ActionResultSimple with:

      • Success: true if chart was generated successfully
      • ResultCode: "SUCCESS" or error code
      • Message: The SVG string or error message