Skip to content

Commit

Permalink
Circles must not rotate in target SVG
Browse files Browse the repository at this point in the history
  • Loading branch information
RYangazov committed May 14, 2024
1 parent de2438f commit fd6d22c
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 14 deletions.
111 changes: 101 additions & 10 deletions docs/dev/notebooks/rotate_points.ipynb

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions future_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
### Fixed
- Livemap: improve "tiles" documentation [[#1093](https://github.com/JetBrains/lets-plot/issues/1093)].
- Undesired vertical scroller when displaying `gggrid` in Jupyter notebook.
- GeoJson structure breaks if the ring start label occurs several times [[#1086](https://github.com/JetBrains/lets-plot/issues/1086)].
- `theme`: left margin doesn't work for the `plot_title` parameter [[#1101](https://github.com/JetBrains/lets-plot/issues/1101)].
- `theme`: left margin doesn't work for the `plot_title` parameter [[#1101](https://github.com/JetBrains/lets-plot/issues/1101)].
- Support for marker rotation [[#736](https://github.com/JetBrains/lets-plot/issues/736)].
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ object AestheticsUtil {
solid: Boolean,
p: DataPointAesthetics,
strokeWidth: Double,
angle: Double,
location: DoubleVector
) {
val fill = fill(filled, solid, p)
Expand All @@ -47,7 +48,6 @@ object AestheticsUtil {
strokeAlpha = alpha(stroke, p)
}

val angle = p.finiteOrNull(Aes.ANGLE) ?: 0.0
shape.update(fill, fillAlpha, stroke, strokeAlpha, strokeWidth, angle, location.x, location.y)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import org.jetbrains.letsPlot.core.plot.base.Aes
import org.jetbrains.letsPlot.core.plot.base.DataPointAesthetics
import org.jetbrains.letsPlot.core.plot.base.aes.AestheticsUtil
import org.jetbrains.letsPlot.core.plot.base.render.point.NamedShape.*
import org.jetbrains.letsPlot.core.plot.base.render.point.symbol.CircleGlyph
import org.jetbrains.letsPlot.core.plot.base.render.point.symbol.Glyph
import org.jetbrains.letsPlot.core.plot.base.render.point.symbol.Glyphs
import org.jetbrains.letsPlot.datamodel.svg.dom.slim.SvgSlimElements
Expand Down Expand Up @@ -59,7 +60,10 @@ object PointShapeSvg {
size,
shape.strokeWidth(p)
)
AestheticsUtil.decorate(glyph, shape.isFilled, shape.isSolid, p, shape.strokeWidth(p), location)

val angle = p.finiteOrNull(Aes.ANGLE).takeIf { glyph !is CircleGlyph } ?: 0.0

AestheticsUtil.decorate(glyph, shape.isFilled, shape.isSolid, p, shape.strokeWidth(p), angle, location)
return glyph
}

Expand Down

0 comments on commit fd6d22c

Please sign in to comment.