Skip to content

Commit 471d606

Browse files
committed
Merge remote-tracking branch 'origin/Translate_legend' into intermediate_steps_labels
# Conflicts: # CHANGELOG.md # test/e2e/test_cases/test_cases.json
2 parents 89090ef + adeab10 commit 471d606

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2135
-2197
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,21 @@
55
### Fixed
66

77
- Legend title bottomPadding extended.
8+
- ColorGradient fromString not increasing position prohibited.
9+
- Fix alpha settings to linear by default:
10+
- Axis: line, title, labels, guides, interlacing, ticks
11+
- Legend: title, dimension markers, measure extrema labels
12+
- Marker: line with connections
13+
- Fix negative ranges on x, y, color (measure) and lightness.
14+
- Fix axis step parameter if not match with the range sign (neg/pos).
15+
- Fix axis interpolation. From now the axis and axis labels are following the markers.
16+
- Fix measure axis labels when the range started after the 2000th step value from origo.
817
- Remove marker labels at intermediate steps.
918

1019
### Added
1120

1221
- New style parameter for the legend scrolling.
22+
- Remove background settings for all text, including title, subtitle and caption.
1323

1424
## [0.12.1] - 2024-08-22
1525

docs/tutorial/chart_layout.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ Promise.all([dataLoaded, mdChartLoaded]).then((results) => {
2525
(chart) => {
2626
return chart.animate({
2727
style: {
28-
title: {
29-
backgroundColor: '#A0A0A0'
30-
},
28+
backgroundColor: '#A0A0A0',
3129
plot: {
3230
backgroundColor: '#D2D2D2'
3331
},

src/apps/qutils/canvas.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,12 @@ void BaseCanvas::text(const Geom::Rect &rect, const std::string &text)
199199
QString::fromStdString(text));
200200
}
201201

202-
void BaseCanvas::setBrushGradient(const Geom::Line &line,
203-
const Gfx::ColorGradient &gradient)
204-
{
205-
QLinearGradient qGradient(toQPoint(line.begin),
206-
toQPoint(line.end));
207-
for (auto stop : gradient.stops) {
208-
qGradient.setColorAt(stop.pos, toQColor(stop.value));
209-
}
202+
void BaseCanvas::setBrushGradient(const Gfx::LinearGradient &gradient)
203+
{
204+
QLinearGradient qGradient(toQPoint(gradient.line.begin),
205+
toQPoint(gradient.line.end));
206+
for (auto &&[pos, value] : gradient.colors.stops)
207+
qGradient.setColorAt(pos, toQColor(value));
210208
painter.setBrush(QBrush(qGradient));
211209
painter.setPen(brushToPen(painter.brush()));
212210
}

src/apps/qutils/canvas.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class BaseCanvas : public Gfx::ICanvas, public Vizzu::Draw::Painter
4646
void text(const Geom::Rect &rect,
4747
const std::string &text) override;
4848

49-
void setBrushGradient(const Geom::Line &line,
50-
const Gfx::ColorGradient &gradient) override;
49+
void setBrushGradient(
50+
const Gfx::LinearGradient &gradient) override;
5151

5252
void frameBegin() override {}
5353
void frameEnd() override {}

src/apps/weblib/jscriptcanvas.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ void JScriptCanvas::text(const Geom::Rect &rect,
170170
text.c_str());
171171
}
172172

173-
void JScriptCanvas::setBrushGradient(const Geom::Line &line,
174-
const Gfx::ColorGradient &gradient)
173+
void JScriptCanvas::setBrushGradient(
174+
const Gfx::LinearGradient &gradient)
175175
{
176-
typedef decltype(gradient.stops)::value_type Stop;
176+
typedef decltype(gradient.colors.stops)::value_type Stop;
177177
static_assert(sizeof(double) == 8);
178178
static_assert(sizeof(Stop) == sizeof(double) * 5);
179179

@@ -189,12 +189,12 @@ void JScriptCanvas::setBrushGradient(const Geom::Line &line,
189189
std::is_same_v<decltype(Stop::value.alpha), double>);
190190

191191
::canvas_setBrushGradient(this,
192-
line.begin.x,
193-
line.begin.y,
194-
line.end.x,
195-
line.end.y,
196-
gradient.stops.size(),
197-
gradient.stops.data());
192+
gradient.line.begin.x,
193+
gradient.line.begin.y,
194+
gradient.line.end.x,
195+
gradient.line.end.y,
196+
gradient.colors.stops.size(),
197+
gradient.colors.stops.data());
198198
}
199199

200200
void JScriptCanvas::frameEnd() { ::canvas_frameEnd(this); }

src/apps/weblib/jscriptcanvas.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class JScriptCanvas : public Gfx::ICanvas, public Draw::Painter
4444
void text(const Geom::Rect &rect,
4545
const std::string &text) override;
4646

47-
void setBrushGradient(const Geom::Line &line,
48-
const Gfx::ColorGradient &gradient) override;
47+
void setBrushGradient(
48+
const Gfx::LinearGradient &gradient) override;
4949

5050
void frameBegin() override;
5151
void frameEnd() override;

src/apps/weblib/ts-api/events.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ export interface Caption extends TextElement {
124124
export interface Legend extends Element {
125125
tagName: 'legend'
126126
channel: string
127-
/** Marker labels y overflow by pixel */
128-
yOverflow: number
127+
scrollTop: number
128+
scrollHeight: number
129129
}
130130

131131
/** Logo element of the chart. */

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,6 @@ definitions:
123123
type: string
124124
enum: [center, left, right]
125125
nullable: true
126-
backgroundColor:
127-
description: The background color of the displayed text.
128-
$ref: Color
129-
nullable: true
130126
numberFormat:
131127
description: |
132128
The format of the number. Only applicable for texts showing numerical

src/base/anim/duration.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ double Duration::sec() const { return msec() / 1000.0; }
6363

6464
Duration &Duration::operator+=(const Duration &other)
6565
{
66-
*this = *this + other;
66+
static_cast<Base &>(*this) += other;
6767
return *this;
6868
}
6969

7070
Duration &Duration::operator-=(const Duration &other)
7171
{
72-
*this = *this - other;
72+
static_cast<Base &>(*this) -= other;
7373
return *this;
7474
}
7575

src/base/anim/easing.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ Easing::Easing(const std::string &name)
1616
{
1717
if (name.empty()) return;
1818

19-
auto nameCopy = name;
20-
Text::SmartString::trim(nameCopy);
21-
22-
if (nameCopy == "none") { func = &Easing::none; }
19+
if (auto nameCopy = Text::SmartString::trim_view(name);
20+
nameCopy == "none") {
21+
func = &Easing::none;
22+
}
2323
else if (nameCopy == "linear") {
2424
func = &Easing::linear;
2525
}
@@ -45,7 +45,7 @@ Easing::Easing(const std::string &name)
4545
func = EasingGradient::Bezier(Geom::Point{0.42, 0},
4646
Geom::Point{0.58, 1});
4747
}
48-
else if (const Text::FuncString f(nameCopy, false);
48+
else if (const Text::FuncString f(name);
4949
f.getName() == "cubic-bezier") {
5050
if (f.getParams().size() != 4)
5151
throw std::logic_error("parameter count missmatch");

0 commit comments

Comments
 (0)