daattali / timevis

📅 Create interactive timeline visualizations in R
http://daattali.com/shiny/timevis-demo/
Other
653 stars 157 forks source link

example of custom css? #18

Closed Myfanwy closed 7 years ago

Myfanwy commented 7 years ago

Hi there,

Thanks for the great R package! I can't find the code used to create the sample data in the "slightly more advanced examples" section of the vignette - specifically I'm having trouble formatting my own dataframe with the css components in the className and style columns to make it look like the png in the vignette (or something like it). Can you point me to where the code that includes the css is?

Thanks so much, Myfanwy

daattali commented 7 years ago

The exact code that the app uses is here

You can see the css file that it uses (specifically look for the rules for "#timelineCustom") to see some of my css, or you can look at the sampleData file there to see the dataframes I use

Myfanwy commented 7 years ago

I really apologize, but I'm still not understanding - I did look through all the code in inst/example prior to opening the issue, I just couldn't pinpoint the css used to create this timeline.

Did it come from this css file, and if so, how should I link to a stylesheet in the timevis function?

daattali commented 7 years ago

Yes it did come from that css file. You link to the css file from the ui. You can look at the ui code and see it makes a reference to the css file. You do need to know how to use css in shiny in order to do this, timevis is not meant to teach you css. I suggest you Google for "R shiny css" if you don't understand how to include css.

Myfanwy commented 7 years ago

Got it - I'm actually just creating a static timeline plot for a scientific poster - no Shiny involved. I was able to change the appearance of some things using the style option as a column in the data, but soon got stuck. I'll keep fiddling. Thanks!

daattali commented 7 years ago

Even if you want to just take a screenshot and you don't need shiny, it might be easier to customize the appearance using a css file in shiny. You can try to copy all the files in the example, substitute your data, and play with the existing css file. Easier to use existing working code then to start from scratch On Nov 2, 2016 1:20 PM, "Myfanwy Johnston" notifications@github.com wrote:

Got it - I'm actually just creating a static timeline plot for a scientific poster - no Shiny involved. I was able to change the appearance of some things using the style option as a column in the data, but soon got stuck. I'll keep fiddling. Thanks!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/daattali/timevis/issues/18#issuecomment-257935027, or mute the thread https://github.com/notifications/unsubscribe-auth/AA6IFFWbxMt-6laGgFe1Z-xwG668jlLVks5q6MZPgaJpZM4Knd1P .

Myfanwy commented 7 years ago

That's really helpful, I'll start there! Thanks again.

HOHOOO commented 7 years ago

I have the same problem, thank u for your suggestion!