Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/utils/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ export const convertLegacyData = (data) => {
tint: 'primary.default',
placement: 'center',
},
{
type: 'bar',
show: false,
size: '100%',
source: { type: 'rect', radius: 3, fill: 'white' },
tint: 'primary.default',
},
Comment on lines +135 to +141

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This bar component configuration is identical to the one used for grids (lines 49-55). To avoid code duplication and improve maintainability, I recommend extracting this object into a constant.

You could define it at a suitable scope, for example, inside the convertLegacyData function, and reuse it in both places.

const defaultBarComponent = {
  type: 'bar',
  show: false,
  size: '100%',
  source: { type: 'rect', radius: 3, fill: 'white' },
  tint: 'primary.default',
};

],
attrs: {
x: transform.x,
Expand Down