Giter VIP home page Giter VIP logo

Comments (2)

jbkunst avatar jbkunst commented on May 28, 2024

Hi @jacob-ogre ,

Have you a minimal reproducible example for test?

from d3wordcloud.

jacob-ogre avatar jacob-ogre commented on May 28, 2024

Interesting...I would like to amend the issue. It is not d3wordcloud + Rmarkdown: that combination works fine on its own. It is using Rmarkdown sites (i.e., rmarkdown::render_site) with d3wordcloud. Here is a minimal example with an index.Rmd:

---
title: "A test"
author: "A Person"
date: "`r Sys.Date()`"
output:
  rmarkdown::html_document:
    css: custom.css
    df_print: paged
    fig_caption: yes
    fig_width: 7
    highlight: tango
    toc: true
    toc_depth: 3
    toc_float: true
---

```{r setup, include=FALSE}
library(d3wordcloud) 
words <- c("I", "love", "this", "package", "but", "I", "don't", "like", "use", "wordclouds!", "voila")
freqs <- rev(seq(length(words))) + 10
```

# H1

This is some standard p text in markdown. The font should be Open Sans 300 weight
for the paragraph, and the title should be 28-point, 800 weight.

```{r p1}
d3wordcloud(words, freqs)
```

_site.yml:

name: "testing"
theme: yeti
navbar:
  title: "A test"
  type: inverse
  right:
    - icon: fa-question-circle fa-lg
      href: mailto:[email protected]

and custom.css:

p, li {
  font-size: larger;
  font-family: "Open Sans";
  font-weight: 300;
}

h1 {
  font-size: 36px;
  font-family: "Garamond";
  font-weight: 700;
  margin-top: 0 !important;
}

.title {
  font-family: "Open Sans";
  font-size: 28pt;
  font-weight: 800;
  padding-top: 20px;
}

If the Rmd is simply knitted then the font weights are fine and the wordcloud renders as expected. But if knitted as a site using rmarkdown::render_site() then the font weights are set to a default (I think 500 or 600) rather than 300 and 800 specified in the css.

Thanks, and apologies for the initial misdiagnosis.

from d3wordcloud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.