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

About domain in clip-path #3684

Closed
m-gallesio opened this issue Mar 8, 2024 · 1 comment
Closed

About domain in clip-path #3684

m-gallesio opened this issue Mar 8, 2024 · 1 comment
Assignees

Comments

@m-gallesio
Copy link

m-gallesio commented Mar 8, 2024

I noticed clip-paths generated by billboard.js use the current domain of the page.
This is not a problem when viewing the chart or using the native billboard.js export, but can cause problems with areas / regions if other ways to export the chart to an image are used (we use this):

image

This is the code which creates clip-path attributes:
https://github.com/naver/billboard.js/blob/master/src/ChartInternal/internals/clip.ts#L36

It references IE9 (way out of support) in which case the domain is skipped, and dates back to C3:
https://github.com/c3js/c3/blob/master/src/clip.ts#L5

The domain is explicitly stripped when using the native billboard.js export:
https://github.com/naver/billboard.js/blob/master/src/Chart/api/export.ts#L89

Of course we can handle this case ourselves (which I plan to do), but at this point I wonder if using the full domain serves any purpose (maybe disambiguation, which is pointless if it gets removed), and if not whether it can be directly skipped in all cases.

@netil
Copy link
Member

netil commented Mar 12, 2024

@m-gallesio, thanks for the suggestion. The full domain is used to not break any compatibility issues which stayed from the c3.js codebase.

Aside of IE9 conditional and based on the url() function definition from MDN, reasonable to remove setting full domain for clip-path's url value.

A string which may specify a URL or the ID of an SVG shape.

@netil netil added the bug label Mar 12, 2024
@netil netil self-assigned this Mar 12, 2024
netil pushed a commit to netil/billboard.js that referenced this issue Mar 13, 2024
Remove ie9 conditional and make setting clip-path's
url() value to specify id value without setting full domain

Ref naver#3684
@netil netil closed this as completed in 83bbd10 Mar 13, 2024
github-actions bot pushed a commit that referenced this issue Mar 18, 2024
## [3.11.3](3.11.2...3.11.3) (2024-03-18)

### Bug Fixes

* **clip:** Remove setting full domain url ([83bbd10](83bbd10)), closes [#3684](#3684)
* **legend:** Fix legend title to show data.names if set ([e8fa131](e8fa131)), closes [#3662](#3662)
* **tooltip:** Fix tooltip y coordinate with arc.rangeText ([d28258e](d28258e)), closes [#3673](#3673)
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