Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
fix: use SVG renderer for labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Niclas Fors committed Jan 12, 2024
1 parent 4714491 commit b0c9e2a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/coloring/picasso/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ export default function coloringFn(resources) {
* @param {string} [cfg.styleReference='object.legend']
* @returns {object}
*/
legend({ eventName, key, styleOptions } = {}) {
legend({ eventName, key, renderer, styleOptions } = {}) {
return legend(
{
eventName,
key,
renderer,
},
{
legendConfig: chartColorModel.getLegendSettings(),
Expand Down
3 changes: 2 additions & 1 deletion src/coloring/picasso/legend/visual.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const legendShow = (legendProps, hc, coloring) => {
};

export function catLegend(componentConfig, opts) {
const { key } = componentConfig;
const { key, renderer } = componentConfig;

const { scaleKey, scales, coloring, hc, constraints, styleOptions } = opts;

Expand All @@ -21,6 +21,7 @@ export function catLegend(componentConfig, opts) {
return {
type: "legend-cat",
key: `${key}-cat`,
renderer,
scale: s in scales ? s : scaleKey,
show: legendShow(opts.legendConfig, hc, coloring),
layout: {
Expand Down
4 changes: 3 additions & 1 deletion src/pic-definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ export default function picDefinition({
};
}

const textRenderer = getTextRenderer(flags);

const colorDatum = picassoColoring.datumProps();
const colorFill = picassoColoring.color();

const leg = picassoColoring.legend({
key: "color-legend",
eventName: "ev",
renderer: textRenderer,
styleOptions: {
title: getLegendTitleStyle(theme, layout, flags),
label: getLegendLabelStyle(theme, layout, flags),
Expand All @@ -86,7 +89,6 @@ export default function picDefinition({
const axisLabelStyle = getAxisLabelStyle(theme, layout, flags);
const valueLabelStyle = getValueLabelStyle(theme, layout, flags);
const allowTooltip = !constraints.passive;
const textRenderer = getTextRenderer(flags);

return {
strategy: {
Expand Down

0 comments on commit b0c9e2a

Please sign in to comment.