Comments (5)
I use vega-lite with org mode.
The main idea is to do this 3 steps to include a vega lite spec in a org mode file:
a)
In a "clojure" block:
- Specify the "spec"
- Convert spec to json and write to disk
(def spec ....
(spit "spec.vl"
(json/generate-string spec))
b)
In a following "shell block":
- convert the json to a svg file using the command line utils
#+BEGIN_SRC shell
vl2svg spec.vl spec.svg
#+END_SRC
c)
Include the "svg" file into org mode via
[[file:spec.svg]]
from oz.
Hi @joinr. Thanks for posting this issue.
As I mentioned on slack, I don't use emacs, and am probably not the best person to be working on this, but I think it's a great idea, and encourage you or any one else interested to put forward a proposal.
Thanks again.
from oz.
@behrica is right - i was able to use vega charts in org-more by relaying on vega-cli tool.
You even don't need oz for that.Here is example for reference
from oz.
Although @behrica's work-flows works,
I wish to be able to write spec in Clojure via Oz, and automatically
get the svg file generated and embedded in org-mode buffer.
The desired work-flow should be similar to the code block of plantuml.
For example,
#+BEGIN_SRC oz :exports :file ./from-vega-lite.svg
spec in Clojure via oz
#+END_SRC
You may find some examples of how convenient to specify diagram with plantuml with org-mode's code block.
With this support, I will be able to use org as markdown syntax to
write document with oz for vega-lite specification, without manually
handling the generation of vega-lite figure generation and embedding the
generated file.
from oz.
Hey @yubrshen.
Right now, you could do something equivalent to what @behrica suggests by using oz.core/export!
. For svg, this will try to use graalvm to render (without having to install the vega-cli using npm or whatever), but for jpg you need canvas, which I don't think graalvm supports yet (though I'd love for someone to prove me wrong on this). This reduces the steps in your org-mode files to 2 instead of 3. You would still need to include the file into org-mode the way @behrica describes (step c).
If there's a way to facilitate a one step process in org-mode, I'm more than happy to accommodate that. I just don't know enough about org-mode to be of much help sorting out that side of it.
The other thing I would really like to support in Oz is ingest of org-mode files and interpretation as hiccup. Perhaps we can even extend Oz's notion of parallelized clj code execution, so that you could use Oz's notebook functionality with org-mode files. I don't know how much control org-mode gives you over what sort of output formats/templates are available, but Oz is quite flexible in this regard, and only becoming more capable. So perhaps it would be useful to have a flexible rendering system (static site generation, pdf documents, etc) for org-mode files?
Happy to discuss more if anything like that makes sense.
Thanks again
from oz.
Related Issues (20)
- Support streaming data into a visualization via core.async chan
- More idiomatic support for reactive data updates (via reagent atom/reaction data inputs)
- More idiomatic support for reactive Vega signals (as reagent atoms/reactions)
- Add option to ingest clj file comments as markdown
- Add function for setting global compile option defaults
- Progressively stream clj file and markdown block evaluations to client
- Stop using prewalk on client for applying components to hiccup docs
- Live-reloading styles
- Add cli
- Oz does not seem to respect the xOffset setting HOT 5
- Clarify that 1.6.0-alpha36 is the current version HOT 2
- Bump vega-lite to 5.2.0 HOT 1
- live-view! function should work on directories HOT 3
- export! error with png
- WARN Missing type for channel "order", using "quantitative" instead.
- Issues using spec with new notebook features
- rebuilding when output file is missing (but input has not changed)
- Unable to embed static rendering on Windows HOT 6
- memory leak when updating reagent component HOT 7
- Incorrect rendition when using `oz/view!`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oz.