-
Notifications
You must be signed in to change notification settings - Fork 3
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
Text
visualisation type
#1035
Comments
Related to: explorable-viz/fluid-examples#10 |
Use AI instead of hand-crafting prose: https://github.com/explorable-viz/research-strategy/issues/165 |
Text
visualisation type
@JosephBond This is the new visualisation type we’ll need to add – I think it can be based on similar principles to our existing viz types, but simpler. Initially it won’t be easy to use, as you’ll need to have a specific uniquely named |
Going to sketch some of my design ideas here over today and tomorrow.
|
Whilst in theory this is "simpler" than other visualizations, it's actually not simpler at all. We need some sort of polymorphism in the |
From my private message to @JosephBond: OK, so here’s my understanding. The inline chunks on their own are a bit more limited than what we’re trying to do. Most of the text is pre-written with the exception of what is being injected between the inline backticks. I think these are the right bits of relevant code:
Not exactly sure how it works, but here is some explanation in the R Markdown book: https://bookdown.org/yihui/rmarkdown/r-code.html Also worth poking at the Knitr book: https://yihui.org/knitr/
|
@JosephBond I’ve had a very quick scan of the above. We can chat more later today, but perhaps we should conceptually separate “atomic visual elements” (visualisations and fragments of text) from the top-level document structure (which might be a sequence of such things, in a literate programming sort of style). For now, I think we can concentrate on the former. We already have visualisations which are computed from data, so we “just” need to add text computed from data. Then we can insert those text elements into existing HTML documents, just as we currently do with visualisations. I think your |
As an example adapted from @RaoOfPhysics‘s <p>Bartlett’s test of sphericity suggests that there is <div id="sig-123">?</div> correlation in ... We could then (naively) compute a
or even:
which when plugged into the |
@JosephBond Started capturing a few subtasks in the issue body. |
@JosephBond Have extracted Examples to a new task, to give us a place to capture some initial ideas.. |
Text
view typeDrawable
Reflect
develop
)See also:
nombre
-inspired library #1040 (library functions)@rolyp and I have had a few thoughts on this, and I’m attempting here to note some of those in a way that hopefully makes sense.
This was partly inspired by my doctoral thesis (a-ch.in/ty-a#research), where, rather than write numbers by hand, I “injected” the results of calculations straight into the text. For example, the source R Markdown file (
.Rmd
) in question had the following text+code:The output looks like this:
In another instance, I had three statistical tests run thrice to confirm if the dataset in question was suitable for the intended analysis. Similar text would need to explain this each time. Rather than write the sentences and numbers by hand, I wrote a set of functions in R, one for each test, which would output the appropriate text whether the test passed or failed, and would include the calculated numbers corresponding to the test:
Then, wherever I had to include the results, I added the following to the R Markdown file (
.Rmd
) of the analysis chapter:The output of that particular bit of code appears in the PDF as follows:
(Other instances are on p. 82 and p. 86.)
What we are proposing is the following:
fluid
with the “visualisation” type and parameters inserted there, which will be converted into the calculated figure in the displayed HTML file: `fluid <some code>`. This will need a bit of fluid code similar to the R packagenombre
, which converts from numbers to text and vice versa: https://nombre.rossellhayes.com/.<mark>
). When selecting specific points in the visualisation, the text should adapt itself based on the underlying data. This can be used for example for dynamic captions, but also for longer paragraphs.The text was updated successfully, but these errors were encountered: