Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option (or default?) to render points as zero-length lines #10

Open
RossPaterson opened this issue May 22, 2022 · 4 comments
Open

option (or default?) to render points as zero-length lines #10

RossPaterson opened this issue May 22, 2022 · 4 comments

Comments

@RossPaterson
Copy link

RossPaterson commented May 22, 2022

Currently it is possible to control the display of lines and areas using the stylesheet, but point objects are always rendered as a circle with radius 1. If a point could be rendered as a zero-length line, i.e. a line with the point as start and end point, users would be able to style the line using the stroke-width property and setting stroke-linecap: round, producing a circle of the desired size.

@fitnr
Copy link
Owner

fitnr commented May 22, 2022

The <circle> element can also be styled with the stroke-width property. Are there other reasons for this feature?

@RossPaterson
Copy link
Author

True, if a bit clunky: one could get a circle of radius n by setting stroke-width to 2(n-1). A line element can also be styled with a marker-start (or marker-end) property, to place an arbitrary marker on the point. Of course anyone doing this would have to add a marker definition to the SVG file. This could be done with a circle too, I suppose, by giving the circle no fill or stroke and moving the marker by one unit.

@fitnr
Copy link
Owner

fitnr commented May 22, 2022

With calc, doing multiplication is relatively low-effort.
A more general change might be to employ a <symbol> and then a <use> element for each point.

@RossPaterson
Copy link
Author

After a bit of testing: styling a large stroke-width on a small circle works with Chrome but not with Firefox, librsvg or Inkscape. Styling a marker-start on a circle only works with Inkscape.

The <use> approach seems less flexible: with a stylesheet, one can use different radii or markers depending on values of attributes of the original objects (e.g. types of settlements).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants