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

Set colors for all charts in the vault #61

Open
ShahriarKh opened this issue Nov 16, 2022 · 4 comments
Open

Set colors for all charts in the vault #61

ShahriarKh opened this issue Nov 16, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@ShahriarKh
Copy link
Contributor

What's your feature?

Currently, changing colors in settings only works for charts created after that. It will be really cool if the plugin supports a way to have "global" color settings, so new colors are applied to all charts in the vault.

Any related problems?

No response

Additional context?

No response

@ShahriarKh ShahriarKh added the enhancement New feature or request label Nov 16, 2022
@leonhma
Copy link
Owner

leonhma commented Nov 16, 2022

The colors are applied every time the HTML for a plot is rerendered. AFAIK this also happens when you reopen obsidian. I haven't found a better way to rerender all plots, although you are welcome to add one if you find it.

@ShahriarKh
Copy link
Contributor Author

Well, I didn't notice that reopening obsidian causes colors to be updated! So, the functionality is already there; we just need to find a way to force re-render plots after saving the settings (I don't know how Obsidian handles this), or at least change the save message a little bit and tell users to "re-open obsidian to apply changes".

@leonhma
Copy link
Owner

leonhma commented Nov 16, 2022

Obsidian renders the code block via the handler function the plugin provided, and then spits out the html into a prepared div. I can't imagine the result is persistent between sessions so it would have to rerender the code block. Changing the message would be the only possible solution I could think of...

@ShahriarKh
Copy link
Contributor Author

I see. At least for now, a helpful message is better than nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants