// (C) 2021-2026 GoodData Corporation
import { BucketNames } from "@gooddata/sdk-ui";
import { PluggableScatterPlot } from "./PluggableScatterPlot.js";
import { getReactEmbeddingCodeGenerator } from "../../../utils/embeddingCodeGenerator/getReactEmbeddingCodeGenerator.js";
import { executionConfigInsightConversion, filtersInsightConversion, localeInsightConversion, singleAttributeBucketConversion, singleMeasureBucketConversion, sortsInsightConversion, } from "../../../utils/embeddingCodeGenerator/insightToPropsConverter/convenience.js";
import { getInsightToPropsConverter } from "../../../utils/embeddingCodeGenerator/insightToPropsConverter/convertor.js";
import { BigChartDescriptor } from "../BigChartDescriptor.js";
import { chartAdditionalFactories, chartConfigInsightConversion } from "../chartCodeGenUtils.js";
export class ScatterPlotDescriptor extends BigChartDescriptor {
    getFactory() {
        return (params) => new PluggableScatterPlot(params);
    }
    getEmbeddingCode = getReactEmbeddingCodeGenerator({
        component: {
            importType: "named",
            name: "ScatterPlot",
            package: "@gooddata/sdk-ui-charts",
        },
        insightToProps: getInsightToPropsConverter({
            xAxisMeasure: singleMeasureBucketConversion("xAxisMeasure", BucketNames.MEASURES),
            yAxisMeasure: singleMeasureBucketConversion("yAxisMeasure", BucketNames.SECONDARY_MEASURES),
            attribute: singleAttributeBucketConversion("attribute", BucketNames.ATTRIBUTE),
            segmentBy: singleAttributeBucketConversion("segmentBy", BucketNames.SEGMENT),
            filters: filtersInsightConversion("filters"),
            sortBy: sortsInsightConversion("sortBy"),
            config: chartConfigInsightConversion("config"),
            locale: localeInsightConversion("locale"),
            execConfig: executionConfigInsightConversion("execConfig"),
        }),
        additionalFactories: chartAdditionalFactories(),
    });
    getMeta() {
        return {
            documentationUrl: "https://www.gooddata.com/docs/gooddata-ui/latest/references/visual_components/scatter_plot",
            supportsExport: true,
            supportsZooming: true,
        };
    }
}
//# sourceMappingURL=ScatterPlotDescriptor.js.map