ProductPromotion
Logo

Elm

made by https://0x3d.site

GitHub - gicentre/litvis: Literate Visualization: Theory, software and examples
Literate Visualization: Theory, software and examples - gicentre/litvis
Visit Site

GitHub - gicentre/litvis: Literate Visualization: Theory, software and examples

GitHub - gicentre/litvis: Literate Visualization: Theory, software and examples

Literate Visualization · License: BSD 3-Clause GitHub Workflow Status (checks) Code style: Prettier Contributor Covenant

A light-touch approach to designing, building and describing visualization. Here you will find

Setting up litvis

(If you unfamiliar with the using npm or configuring editors, you can view these more detailed setup instructions that show you how to install and set up VSCode to work with litvis.)

Litvis documents can be viewed and created in the VS Code editor:

  1. If you don't have it already, install Node.js. This will allow you to use npm, used for installing some of the other necessary software.

  2. Install Elm from the official Elm install page (there's no need to follow the "after installation is complete..." tests).

  3. Create a project folder to contain your litvis work. Open a terminal window and cd to that project folder. Install Prettier and Prettier Elm plugin with the following commands:

    npm init --yes
    npm install prettier prettier-plugin-elm
    echo "{ \"plugins\": [\"prettier-plugin-elm\"] }" > .prettierrc.json
    
  4. If you don't have it already, install the VS Code editor.

  5. Install the litvis extensions:

    • Select View → Extensions

    • Search for markdown-preview-enhanced-with-litvis and then click install next to the returned result (main litvis functionality).

    • Search for prettier - Code formatter and install (auto-formats code).

    • Search for elm tooling and install (syntax highlighting of Elm code).

  6. Configuring Your Editor

    To make using litvis as smooth as possible, we recommend the following editor configuration options:

    • Under Preferences->Settings, change the following from their default settings:
      • Text Editor -> Formatting: ensure Format On Save is ticked
      • Extensions -> Markdown Preview Enhanced with litvis: ensure Live Update is not ticked.

You should now be good to go! Get started by writing your first litvis document and looking at these tutorials.

‘Hello world’ in literate Elm

Adding litvis attribute l (or literate) to elm blocks in markdown automatically compiles and executes the code in real time. Attribute r (or raw) is the simplest way to see the result.

helloworld

examples/features/helloWorld.md

Simple litvis chart

A litvis code block with attribute v (or visualize) automatically renders the declared symbol using elm-vegalite or elm-vega.

simplechart

examples/features/simpleChart.md

Code referencing across blocks

By default, litvis code blocks share the same execution context, which means that an Elm symbol defined in one block and can be referenced in another block. Blocks can be placed in any order.

codereferencingcodeblocks

examples/features/codeReferencingAcrossBlocks.md

Code referencing with triple hat notation

Symbols from Elm code blocks can be referenced in any part of the markdown using triple hat notation (^^^).

codereferencingtriplehat

examples/features/codeReferencingWithTripleHatNotation.md

Code referencing with parameters

Triple hat references accept parametrized function calls, which makes it easy to combine text with graphics and produce families of related graphics. This means that small multiples and embedded graphics such as sparklines are straightforward.

codereferencingparams

examples/features/codeReferencingWithParameters.md

Debugging Code

A litvis document that is being previewed is constantly checked for program validity. Any issues that are detected are displayed in the editing environment and help with debugging. If a visualization has been successfully rendered before the issue had occurred, its old preview is shown to avoid unwanted markup reflows.

Replacing v with r for raw or j for json makes it possible to look into generated vega-lite specs. This can help debugging more deeply embedded problems or for generating standard JSON Vega/Vega-Lite specifications.

debuggingvegalite

examples/features/debuggingVegaLite.md

Interaction

Adding interactive to a code block with v or a triple hat reference makes visualizations live if interaction is described within Spec. User input controls can be added to the document, if desired.

interaction

examples/features/interaction.md

Multiple execution contexts

Although a single Elm execution context may be sufficient in many litvis narratives, context isolation may be desired in some cases. A number of code block attributes such as context, id, follows, isolated and siding enable fine-grained control of Elm symbol visibility, thus making it easier to accomplish certain tasks.

A siding (or s) is a shortcut for isolated follows=default. This keyword makes previously defined symbols in default context available within the code block, but avoids name clashes with any blocks later in the document.

codesidings

examples/features/codeSidings.md

Branching narratives

A litvis narrative can be split between multiple markdown documents, where each document follows its parent. This enables routine use of parallel branching narratives that assemble and structure document trees. Each branch in a tree can represent alternative designs each with their own rationale or focus for analysis.

branchingnarratives

examples/features/branching/root.md > examples/features/branching/branchA.md > examples/features/branching/branchB.md

Narrative schemas

A litvis narrative can be linked to a set of YAML files, which define labels, rules and styling. These narrative schemas can be thought of as an analogue of schemas more usually found in declarative programming contexts such as JSON and XML schema.

The purpose of the schema is to provide a set of structured guidelines to assist in writing the narrative content around visualizations. This can be thought of as form of scaffolding to assist in the process of design exposition or reasoning. Schemas can be used to validate litvis documents.

narrativeschemas

examples/crossQuadCharts.md > narrative-schemas/idiom.yml

Automatic code formatting

Litvis integrates with Prettier and its Elm plugin, which enables seamless document formatting as the narrative is being written. A file is automatically prettified on save or when the Format command is explicitly called. Formatting keeps litvis files in a readable and maintainable state, which eases collaboration and reduces distraction from the higher-level tasks.

formatting1000

examples/lunarEclipse.md

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory