-
-
Notifications
You must be signed in to change notification settings - Fork 157
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
Locale support #21
Comments
Bonjour Pierre
I'm sorry but I don't have an answer for you. I wouldn't want to include
moment by default, but I don't know how to solve your problem. This feels
like a question that's general to htmlwidgets rather than specific to
timevis, so perhaps you could try asking about this in the htmlwidgets repo?
…On Dec 29, 2016 6:04 AM, "Pierre Formont" ***@***.***> wrote:
Hi Dean and thanks for the great package.
I'd like to use it but with a French locale which is not natively
supported by vis.js. It is possible to include moment.js with locales in
the page in order to have locale support, which is great.
However, moment needs to be included *before* vis.js for this to work. So
I tried several things:
1. the easiest is to add *moment-with-locales.min.js* as the first
dependency in *timevis.yaml*, which is what I've done locally but
including a 280KB library for a specific use case seems overkill,
2. I tried adding the dependency dynamically in *timevis.R* this way:
if (!is.null(options$locale)) {
deps <- c(
deps,
list(
htmltools::htmlDependency(
name = "moment",
version = "2.17.1",
src = system.file("htmlwidgets/lib/moment-2.17.1", package = "timevis"),
script = "moment-with-locales.min.js"
)
)
)
}
which does not work because these dependencies are included after the ones
in the YAML config file
1. it's the same problem when trying to include it directly in a Shiny
app with tags$head(tags$script(src = ...)), it is loaded after all the
other dependencies
So do you have any ideas how to proceed from there ? Maybe updating the
html_dependency structure from *htmltools* in order to include an
include_before field ?
Thanks,
Pierre
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#21>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA6IFNpOWeUM6hmAmApS-itK1rEo9wKGks5rM5OwgaJpZM4LXggf>
.
|
Thanks for your answer Dean, I'll open an issue on the htmlwidgets repo ! |
Feel free to link to this issue to show an example of your usecase
…On Dec 30, 2016 3:24 AM, "Pierre Formont" ***@***.***> wrote:
Closed #21 <#21>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#21 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA6IFE3b08Iy5L6J1MsdHbXiXoQZ1BXVks5rNL-_gaJpZM4LXggf>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Dean and thanks for the great package.
I'd like to use it but with a French locale which is not natively supported by
vis.js
. It is possible to includemoment.js
with locales in the page in order to have locale support, which is great.However,
moment
needs to be included beforevis.js
for this to work. So I tried several things:which does not work because these dependencies are included after the ones in the YAML config file
tags$head(tags$script(src = ...))
, it is loaded after all the other dependenciesSo do you have any ideas how to proceed from there ? Maybe updating the
html_dependency
structure from htmltools in order to include aninclude_before
field ?Thanks,
Pierre
The text was updated successfully, but these errors were encountered: