Skip to content

Commit 5798871

Browse files
authored
Merge pull request #632 from vizzuhq/axis_refactor_v12-13-rev
Axis refactor v12 13 review changes
2 parents b1307f1 + 5ff7883 commit 5798871

File tree

15 files changed

+59
-36
lines changed

15 files changed

+59
-36
lines changed

.github/workflows/docker-vizzu-dev-desktop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Docker publish vizzu-dev-desktop
22

33
on:
4-
push:
4+
pull_request:
55
branches-ignore:
66
- main
77
paths:

.github/workflows/docker-vizzu-dev-wasm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Docker publish vizzu-dev-wasm
22

33
on:
4-
push:
4+
pull_request:
55
branches-ignore:
66
- main
77
paths:

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
- Waterfall chart preset not aligned.
99
- Split chart count negative values too.
1010
- Split chart handled when same dimension on main and sub axis.
11+
- Add record didn't handle when a measure got an empty string.
12+
- Fix no fontparent set bug.
1113

1214
### Changed
1315

@@ -20,8 +22,8 @@
2022

2123
### Added
2224

23-
- Separate Channel properties to AxisChannel properties at config.
24-
- Move split align sort and reverse to AxisChannel
25+
- Separate AxisChannel properties from Channel properties at config.
26+
- Move split align sort and reverse from config to AxisChannel config.
2527
- Add new sorting strategy: 'byLabel'.
2628
- Enable split and align on mainAxis.
2729
- Add 'isContiguous' property for dimension series

src/apps/weblib/typeschema-api/config.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ definitions:
7878
- { type: string, enum: [auto] }
7979

8080
AxisChannel:
81+
$extends: Channel
8182
description: |
8283
AxisChannels are special channel settings for the positional channels.
8384
type: object
@@ -138,18 +139,14 @@ definitions:
138139
type: object
139140
properties:
140141
x:
141-
allOf:
142-
- $ref: Channel
143-
- $ref: AxisChannel
142+
$ref: AxisChannel
144143
description: |
145144
Parameters for the X-axis, determining the position of the markers on the
146145
x-axis - or their angle when using polar coordinates.
147146
Note: leaving x and y channels empty will result in a
148147
chart "without coordinates" like a Treemap or a Bubble Chart.
149148
y:
150-
allOf:
151-
- $ref: Channel
152-
- $ref: AxisChannel
149+
$ref: AxisChannel
153150
description: |
154151
Parameters for the Y-axis, determining the position of the markers on the
155152
y-axis - or their radius when using polar coordinates) .

src/chart/animator/keyframe.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ void Keyframe::prepareActual()
7171
prepareActualMarkersInfo();
7272

7373
actual = std::make_shared<Gen::Plot>(*source);
74+
actual->getStyle().setup();
7475
actual->detachOptions();
7576
}
7677

@@ -92,6 +93,7 @@ void Keyframe::copyTarget()
9293
if (!targetCopy) {
9394
targetCopy = target;
9495
target = std::make_shared<Gen::Plot>(*targetCopy);
96+
target->getStyle().setup();
9597
target->detachOptions();
9698
}
9799
}

src/chart/generator/plot.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ Plot::Plot(PlotOptionsPtr opts, Styles::Chart style) :
5858
guides(*opts),
5959
options(std::move(opts)),
6060
style(std::move(style))
61-
{}
61+
{
62+
this->style.setup();
63+
}
6264

6365
void Plot::detachOptions()
6466
{

src/chart/main/chart.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Chart::Chart() :
2929
*events.animation.begin,
3030
*events.animation.complete)
3131
{
32+
computedStyles.setup();
3233
animator.onDraw.attach(
3334
[this](const Gen::PlotPtr &actPlot)
3435
{
@@ -72,8 +73,9 @@ void Chart::animate(Anim::Animation::OnComplete &&onComplete)
7273
}
7374
else {
7475
*nextOptions = prevOptions;
75-
actStyles = prevStyles;
76+
setStyles(prevStyles);
7677
computedStyles = plot->getStyle();
78+
computedStyles.setup();
7779
}
7880
});
7981

@@ -132,6 +134,7 @@ Gen::PlotPtr Chart::plot(const Gen::PlotOptionsPtr &options)
132134
Styles::Sheet::setAfterStyles(*res, layout.boundary.size);
133135

134136
computedStyles = res->getStyle();
137+
computedStyles.setup();
135138

136139
return res;
137140
}

src/chart/main/style.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ struct FontParentSetter
584584
{}
585585
};
586586

587-
void Chart::setup()
587+
void Chart::setup() &
588588
{
589589
Refl::visit(FontParentSetter{this}, *this);
590590
fontParent = &getDefaultFont();

src/chart/main/style.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ struct Chart : Padding, Box, Font, ChartParams
401401
static const Gfx::ColorPalette &getDefaultColorPalette();
402402
static Chart def();
403403

404-
void setup();
404+
void setup() &;
405405
};
406406

407407
}

src/chart/main/stylesheet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Chart Sheet::getFullParams(const Gen::PlotOptionsPtr &options,
5151
void Sheet::calcDefaults(const Geom::Size &size)
5252
{
5353
defaultParams = Chart::def();
54+
defaultParams.setup();
5455

5556
defaultParams.fontSize = Gfx::Length{baseFontSize(size, true)};
5657

@@ -219,7 +220,6 @@ void Sheet::setData()
219220
void Sheet::setAfterStyles(Gen::Plot &plot, const Geom::Size &size)
220221
{
221222
auto &style = plot.getStyle();
222-
style.setup();
223223

224224
if (auto &xLabel =
225225
style.plot

0 commit comments

Comments
 (0)