Skip to content

Render mark #292

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

Closed
wants to merge 2 commits into from
Closed

Render mark #292

wants to merge 2 commits into from

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Apr 1, 2021

I've made two versions of this (in two consecutive commits):

    1. the function mark: marks: [ () => svg'<text>function mark' ]
    1. the render mark: marks: [ { render: () => svg'<text>render mark' } ]

The second solution is imo much better since you can discover it by inspecting a mark. (It might be hard to figure out what initialize does without reading the documentation, but the render function is immediate and simple.)

closes #182

Fil added 2 commits April 1, 2021 19:15
```
Plot.plot({
  marks: [ () => svg`<text transform="translate(20,20)">Hello, function mark` ]
})
```

closes #182
```
Plot.plot({
  marks: [ { render: () => svg`<text transform="translate(120,20)">Hello, function mark` } ]
})
```

closes #182
@Fil Fil force-pushed the render-mark-182 branch from 9cce440 to 2dca478 Compare April 1, 2021 17:26
@Fil Fil changed the title Render mark 182 Render mark Apr 1, 2021
@Fil Fil requested review from mbostock, enjalot and tophtucker April 1, 2021 17:27
@enjalot
Copy link

enjalot commented Apr 1, 2021

I agree the second one is more explicit and consistent. someone reading a plot with this kind of mark would also be more likely to deduce what's happening. someone writing a custom plugin would already be likely to understand initialize and its implications.

@tophtucker
Copy link
Contributor

i like it!!

@Fil
Copy link
Contributor Author

Fil commented Apr 6, 2021

see also #299

@Fil Fil added the enhancement New feature or request label May 1, 2021
@mbostock mbostock removed the enhancement New feature or request label Aug 11, 2021
@mbostock
Copy link
Member

Closing in favor of #498.

@mbostock mbostock closed this Aug 11, 2021
@Fil Fil deleted the render-mark-182 branch October 16, 2022 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function marks?
4 participants