How to use the d3fc.seriesSvgPoint function in d3fc

To help you get started, we’ve selected a few d3fc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github finos / perspective / packages / perspective-viewer-d3fc / src / js / series / categoryPointSeries.js View on Github external
export function categoryPointSeries(settings, seriesKey, color, symbols) {
    let series = fc.seriesSvgPoint().size(100);
    const opacity = settings.colorStyles && settings.colorStyles.opacity;

    if (symbols) {
        series.type(symbols(seriesKey));
    }

    series.decorate(selection => {
        selection.style("stroke", d => withoutOpacity(color(d.colorValue || seriesKey))).style("fill", d => withOpacity(color(d.colorValue || seriesKey), opacity));
    });

    return series.crossValue(d => d.crossValue).mainValue(d => d.mainValue);
}
github ScottLogic / StockFlux / packages / stockflux-watchlist / src / components / minichart / Minichart.js View on Github external
const getPoint = () => {
  return seriesSvgPoint()
    .crossValue(d => d.date)
    .mainValue(d => d.close);
};
github finos / perspective / packages / perspective-viewer-d3fc / src / js / series / pointSeries.js View on Github external
export function pointSeries(settings, seriesKey, size, colour, symbols) {
    let series = fc
        .seriesSvgPoint()
        .crossValue(d => d.x)
        .mainValue(d => d.y);

    if (size) {
        series.size(d => size(d.size));
    }
    if (symbols) {
        series.type(symbols(seriesKey));
    }

    series.decorate(selection => {
        tooltip()(selection, settings);
        if (colour) {
            selection.style("stroke", d => withoutOpacity(colour(d.colorValue || seriesKey))).style("fill", d => withOpacity(colour(d.colorValue || seriesKey)));
        }
github ScottLogic / StockFlux / legacy / src / child / components / minichart / Minichart.js View on Github external
.range([height, 0])
            .nice();

        const area = seriesSvgArea()
            .crossValue((d) => d.date)
            .baseValue((_) => closeExtent[0])
            .mainValue((d) => d.close)
            .decorate((selection) => {
                selection.attr('fill', `url(#${stockCode}-minichart-gradient)`);
            });

        const line = seriesSvgLine()
            .crossValue((d) => d.date)
            .mainValue((d) => d.close);

        const point = seriesSvgPoint()
            .crossValue((d) => d.date)
            .mainValue((d) => d.close);

        const multi = seriesSvgMulti()
            .series([area, line, point])
            .xScale(xScale)
            .yScale(yScale)
            .mapping((_, index, series) => {
                switch (series[index]) {
                case point:
                    return [data.slice(0)[0]];
                default:
                    return data;
                }
            });
        container