Skip to content

Commit c44bb2f

Browse files
committed
- Fix bug in AGG text sizing
- Clean up comments in GraphLayout/Heatmap
1 parent 5562eb7 commit c44bb2f

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

Sources/AGGRenderer/CPPAGGRenderer/CPPAGGRenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ namespace CPPAGGRenderer{
506506
if (outW)
507507
*outW = x;
508508
if (outH)
509-
*outH = maxY - abs(minY);
509+
*outH = abs(maxY - minY);
510510
}
511511

512512
unsigned save_image(const char *s, const char** errorDesc){

Sources/SwiftPlot/GraphLayout.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ public enum LegendIcon {
55
case shape(ScatterPlotSeriesOptions.ScatterPattern, Color)
66
}
77

8-
// TODO: Add layout tests for:
9-
// - No axes labels
10-
// - No plot markers
11-
// - No axes labels or plot markers
12-
138
/// A component for laying-out and rendering rectangular graphs.
149
///
1510
/// The principle 3 components of a `GraphLayout` are:
@@ -134,7 +129,7 @@ extension GraphLayout {
134129
.padding(.all(Self.xLabelPadding))
135130
elements.bottom.append(label)
136131
// Add a space, otherwise the label looks misaligned.
137-
elements.bottom.append(FixedSpace(size: Self.titleLabelPadding))
132+
elements.bottom.append(FixedSpace(size: Self.xLabelPadding/2))
138133
} else {
139134
elements.bottom.append(FixedSpace(size: Self.xLabelPadding))
140135
}

Sources/SwiftPlot/Heatmap.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Todo list for Heatmap:
22
// - Spacing between blocks
33
// - Setting X/Y axis labels
4+
// - Setting element label
45
// - Displaying colormap next to plot
56

67
/// A heatmap is a plot of 2-dimensional data, where each value is assigned a colour value along a gradient.
@@ -135,12 +136,7 @@ extension Heatmap: HasGraphLayout, Plot {
135136
let offset = mapping.interpolate(element, range.min, range.max)
136137
let color = colorMap.colorForOffset(offset)
137138
renderer.drawSolidRect(rect, fillColor: color, hatchPattern: .none)
138-
// renderer.drawText(text: String(describing: element),
139-
// location: rect.origin + Point(50,50),
140-
// textSize: 20,
141-
// color: .white,
142-
// strokeWidth: 2,
143-
// angle: 0)
139+
// TODO: Element text.
144140
}
145141
}
146142
}

Tests/SwiftPlotTests/Heatmap/heatmap.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ final class HeatmapTests: SwiftPlotTestCase {
3030
}
3131
try renderAndVerify(heatmap, size: Size(width: 900, height: 450))
3232
}
33-
try renderAndVerify(summer, size: Size(width: 900, height: 450))
34-
}
3533
}
3634

3735
// Data used to generate Heatmaps.

0 commit comments

Comments
 (0)