diff --git a/tests/data/markdown/markmap.toml b/tests/data/markdown/markmap.toml new file mode 100644 index 000000000..72c7482d1 --- /dev/null +++ b/tests/data/markdown/markmap.toml @@ -0,0 +1,403 @@ +markdown = """ +### Markmap + +```{markmap} + +# Digital Identifiers and Rights + +## Community and Outreach + +- Experts +- Grant organizations +- IT ministries +- Journalism schools +- Journalists and reporters +- Partnerships + - Patrons + - Sponsors +- Policymakers +- Rights activists +- Startups +- Thinktanks +- Venture capital +- Volunteers + +## Domains + +- Border controls +- Citizenship +- Digital data trusts +- FinTech +- Government +- Health services delivery +- Hospitality +- Law enforcement +- Online retail and commerce +- Smart automation +- Social media +- Travel and tourism + +## Location + +- International +- Local or domestic +- Transit + +## Output and Outcomes + +- Best practices guide for product/service development +- Conference +- Conversations (eg. Twitter Spaces) +- Masterclass webinars +- Proceedings (talk playlist) +- Reports +- Review of Policies + +## Themes + +### Digital Identity + +- Anonymity +- Architecture of digital trust +- Control and ownership +- Identity and identifier models +- Inclusion and exclusion +- Portability +- Principles +- Regulations +- Reputation +- Rights and agency +- Trust framework +- Verifiability +- Vulnerable communities + +### Digital Rights + +- Current state across region +- Harms +- Emerging regulatory requirements +- Web 3.0 and decentralization +- Naturalization + +## Streams + +- Banking and finance +- Data exchange and interoperability +- Data governance models +- Data markets +- Digital identifiers and identity systems +- Digital public goods +- Digital public services +- Humanitarian activity and aid +- Identity ecosystems +- Innovation incubation incentives + - Public investment + - Private capital +- Local regulations and laws +- National policies +- Public health services +- Records (birth, death, land etc) +``` +""" + +[config] +profiles = [ "basic", "document",] + +[config.custom_profiles.markmap] +args_config = "default" +plugins = [ "markmap",] +[expected_output] +basic = """

Markmap

+

+# Digital Identifiers and Rights
+
+## Community and Outreach
+
+- Experts
+- Grant organizations
+- IT ministries
+- Journalism schools
+- Journalists and reporters
+- Partnerships
+  - Patrons
+  - Sponsors
+- Policymakers
+- Rights activists
+- Startups
+- Thinktanks
+- Venture capital
+- Volunteers
+
+## Domains
+
+- Border controls
+- Citizenship
+- Digital data trusts
+- FinTech
+- Government
+- Health services delivery
+- Hospitality
+- Law enforcement
+- Online retail and commerce
+- Smart automation
+- Social media
+- Travel and tourism
+
+## Location
+
+- International
+- Local or domestic
+- Transit
+
+## Output and Outcomes
+
+- Best practices guide for product/service development
+- Conference
+- Conversations (eg. Twitter Spaces)
+- Masterclass webinars
+- Proceedings (talk playlist)
+- Reports
+- Review of Policies
+
+## Themes
+
+### Digital Identity
+
+- Anonymity
+- Architecture of digital trust
+- Control and ownership
+- Identity and identifier models
+- Inclusion and exclusion
+- Portability
+- Principles
+- Regulations
+- Reputation
+- Rights and agency
+- Trust framework
+- Verifiability
+- Vulnerable communities
+
+### Digital Rights
+
+- Current state across region
+- Harms
+- Emerging regulatory requirements
+- Web 3.0 and decentralization
+- Naturalization
+
+## Streams
+
+- Banking and finance
+- Data exchange and interoperability
+- Data governance models
+- Data markets
+- Digital identifiers and identity systems
+- Digital public goods
+- Digital public services
+- Humanitarian activity and aid
+- Identity ecosystems
+- Innovation incubation incentives
+  - Public investment
+  - Private capital
+- Local regulations and laws
+- National policies
+- Public health services
+- Records (birth, death, land etc)
+
+""" +document = """

Markmap

+
+# Digital Identifiers and Rights + +## Community and Outreach + +- Experts +- Grant organizations +- IT ministries +- Journalism schools +- Journalists and reporters +- Partnerships +- Patrons +- Sponsors +- Policymakers +- Rights activists +- Startups +- Thinktanks +- Venture capital +- Volunteers + +## Domains + +- Border controls +- Citizenship +- Digital data trusts +- FinTech +- Government +- Health services delivery +- Hospitality +- Law enforcement +- Online retail and commerce +- Smart automation +- Social media +- Travel and tourism + +## Location + +- International +- Local or domestic +- Transit + +## Output and Outcomes + +- Best practices guide for product/service development +- Conference +- Conversations (eg. Twitter Spaces) +- Masterclass webinars +- Proceedings (talk playlist) +- Reports +- Review of Policies + +## Themes + +### Digital Identity + +- Anonymity +- Architecture of digital trust +- Control and ownership +- Identity and identifier models +- Inclusion and exclusion +- Portability +- Principles +- Regulations +- Reputation +- Rights and agency +- Trust framework +- Verifiability +- Vulnerable communities + +### Digital Rights + +- Current state across region +- Harms +- Emerging regulatory requirements +- Web 3.0 and decentralization +- Naturalization + +## Streams + +- Banking and finance +- Data exchange and interoperability +- Data governance models +- Data markets +- Digital identifiers and identity systems +- Digital public goods +- Digital public services +- Humanitarian activity and aid +- Identity ecosystems +- Innovation incubation incentives +- Public investment +- Private capital +- Local regulations and laws +- National policies +- Public health services +- Records (birth, death, land etc) +
+""" +markmap = """

Markmap

+
+# Digital Identifiers and Rights + +## Community and Outreach + +- Experts +- Grant organizations +- IT ministries +- Journalism schools +- Journalists and reporters +- Partnerships +- Patrons +- Sponsors +- Policymakers +- Rights activists +- Startups +- Thinktanks +- Venture capital +- Volunteers + +## Domains + +- Border controls +- Citizenship +- Digital data trusts +- FinTech +- Government +- Health services delivery +- Hospitality +- Law enforcement +- Online retail and commerce +- Smart automation +- Social media +- Travel and tourism + +## Location + +- International +- Local or domestic +- Transit + +## Output and Outcomes + +- Best practices guide for product/service development +- Conference +- Conversations (eg. Twitter Spaces) +- Masterclass webinars +- Proceedings (talk playlist) +- Reports +- Review of Policies + +## Themes + +### Digital Identity + +- Anonymity +- Architecture of digital trust +- Control and ownership +- Identity and identifier models +- Inclusion and exclusion +- Portability +- Principles +- Regulations +- Reputation +- Rights and agency +- Trust framework +- Verifiability +- Vulnerable communities + +### Digital Rights + +- Current state across region +- Harms +- Emerging regulatory requirements +- Web 3.0 and decentralization +- Naturalization + +## Streams + +- Banking and finance +- Data exchange and interoperability +- Data governance models +- Data markets +- Digital identifiers and identity systems +- Digital public goods +- Digital public services +- Humanitarian activity and aid +- Identity ecosystems +- Innovation incubation incentives +- Public investment +- Private capital +- Local regulations and laws +- National policies +- Public health services +- Records (birth, death, land etc) +
+""" diff --git a/tests/data/markdown/mermaid.toml b/tests/data/markdown/mermaid.toml new file mode 100644 index 000000000..ab0d577ce --- /dev/null +++ b/tests/data/markdown/mermaid.toml @@ -0,0 +1,450 @@ +markdown = """ +# mermaid tests + +## Flowchart + +```{mermaid} +graph TD + A[Christmas] -->|Get money| B(Go shopping) + B --> C{Let me think} + C -->|One| D[Laptop] + C -->|Two| E[iPhone] + C -->|Three| F[fa:fa-car Car] +``` + +## Sequence Diagrams + +``` {mermaid} +sequenceDiagram + Alice->>+John: Hello John, how are you? + Alice->>+John: John, can you hear me? + John-->>-Alice: Hi Alice, I can hear you! + John-->>-Alice: I feel great! +``` + +## Class Diagram + +``` {mermaid} +classDiagram + Animal <|-- Duck + Animal <|-- Fish + Animal <|-- Zebra + Animal : +int age + Animal : +String gender + Animal: +isMammal() + Animal: +mate() + class Duck{ + +String beakColor + +swim() + +quack() + } + class Fish{ + -int sizeInFeet + -canEat() + } + class Zebra{ + +bool is_wild + +run() + } +``` + +## State Diagram + +``` {mermaid} +stateDiagram-v2 + [*] --> Still + Still --> [*] + Still --> Moving + Moving --> Still + Moving --> Crash + Crash --> [*] +``` + +## Gantt Chart + +``` {mermaid} + title A Gantt Diagram + dateFormat YYYY-MM-DD + section Section + A task :a1, 2014-01-01, 30d + Another task :after a1 , 20d + section Another + Task in sec :2014-01-12 , 12d + another task : 24d +``` + +## Pie Chart + +``` {mermaid} +pie title Pets adopted by volunteers + "Dogs" : 386 + "Cats" : 85 + "Rats" : 15 + +``` + +## ER Diagram + +```{mermaid} +erDiagram + CUSTOMER }|..|{ DELIVERY-ADDRESS : has + CUSTOMER ||--o{ ORDER : places + CUSTOMER ||--o{ INVOICE : "liable for" + DELIVERY-ADDRESS ||--o{ ORDER : receives + INVOICE ||--|{ ORDER : covers + ORDER ||--|{ ORDER-ITEM : includes + PRODUCT-CATEGORY ||--|{ PRODUCT : contains + PRODUCT ||--o{ ORDER-ITEM : "ordered in" +``` + +## User Journey + +``` {mermaid} + journey + title My working day + section Go to work + Make tea: 5: Me + Go upstairs: 3: Me + Do work: 1: Me, Cat + section Go home + Go downstairs: 5: Me + Sit down: 3: Me + +``` + +## Git Graph + +``` {mermaid} + gitGraph + commit + commit + branch develop + checkout develop + commit + commit + checkout main + merge develop + commit + commit + +``` +""" + +[config] +profiles = [ "basic", "document",] + +[config.custom_profiles.mermaid] +args_config = "default" +plugins = [ "mermaid",] + + +[expected_output] +basic = """

mermaid tests

+

Flowchart

+
graph TD
+    A[Christmas] -->|Get money| B(Go shopping)
+    B --> C{Let me think}
+    C -->|One| D[Laptop]
+    C -->|Two| E[iPhone]
+    C -->|Three| F[fa:fa-car Car]
+
+

Sequence Diagrams

+
sequenceDiagram
+    Alice->>+John: Hello John, how are you?
+    Alice->>+John: John, can you hear me?
+    John-->>-Alice: Hi Alice, I can hear you!
+    John-->>-Alice: I feel great!
+
+

Class Diagram

+
classDiagram
+    Animal <|-- Duck
+    Animal <|-- Fish
+    Animal <|-- Zebra
+    Animal : +int age
+    Animal : +String gender
+    Animal: +isMammal()
+    Animal: +mate()
+    class Duck{
+      +String beakColor
+      +swim()
+      +quack()
+    }
+    class Fish{
+      -int sizeInFeet
+      -canEat()
+    }
+    class Zebra{
+      +bool is_wild
+      +run()
+    }
+
+

State Diagram

+
stateDiagram-v2
+    [*] --> Still
+    Still --> [*]
+    Still --> Moving
+    Moving --> Still
+    Moving --> Crash
+    Crash --> [*]
+
+

Gantt Chart

+
    title A Gantt Diagram
+    dateFormat  YYYY-MM-DD
+    section Section
+    A task :a1, 2014-01-01, 30d
+    Another task :after a1  , 20d
+    section Another
+    Task in sec :2014-01-12  , 12d
+    another task : 24d
+
+

Pie Chart

+
pie title Pets adopted by volunteers
+    "Dogs" : 386
+    "Cats" : 85
+    "Rats" : 15
+
+
+

ER Diagram

+
erDiagram
+          CUSTOMER }|..|{ DELIVERY-ADDRESS : has
+          CUSTOMER ||--o{ ORDER : places
+          CUSTOMER ||--o{ INVOICE : "liable for"
+          DELIVERY-ADDRESS ||--o{ ORDER : receives
+          INVOICE ||--|{ ORDER : covers
+          ORDER ||--|{ ORDER-ITEM : includes
+          PRODUCT-CATEGORY ||--|{ PRODUCT : contains
+          PRODUCT ||--o{ ORDER-ITEM : "ordered in"
+
+

User Journey

+
  journey
+    title My working day
+    section Go to work
+      Make tea: 5: Me
+      Go upstairs: 3: Me
+      Do work: 1: Me, Cat
+    section Go home
+      Go downstairs: 5: Me
+      Sit down: 3: Me
+
+
+

Git Graph

+
    gitGraph
+      commit
+      commit
+      branch develop
+      checkout develop
+      commit
+      commit
+      checkout main
+      merge develop
+      commit
+      commit
+
+
+""" +document = """

mermaid tests

+

Flowchart

+
graph TD + A[Christmas] -->|Get money| B(Go shopping) + B --> C{Let me think} + C -->|One| D[Laptop] + C -->|Two| E[iPhone] + C -->|Three| F[fa:fa-car Car] +
+

Sequence Diagrams

+
sequenceDiagram + Alice->>+John: Hello John, how are you? + Alice->>+John: John, can you hear me? + John-->>-Alice: Hi Alice, I can hear you! + John-->>-Alice: I feel great! +
+

Class Diagram

+
classDiagram + Animal <|-- Duck + Animal <|-- Fish + Animal <|-- Zebra + Animal : +int age + Animal : +String gender + Animal: +isMammal() + Animal: +mate() + class Duck{ + +String beakColor + +swim() + +quack() + } + class Fish{ + -int sizeInFeet + -canEat() + } + class Zebra{ + +bool is_wild + +run() + } +
+

State Diagram

+
stateDiagram-v2 + [*] --> Still + Still --> [*] + Still --> Moving + Moving --> Still + Moving --> Crash + Crash --> [*] +
+

Gantt Chart

+
title A Gantt Diagram + dateFormat YYYY-MM-DD + section Section + A task :a1, 2014-01-01, 30d + Another task :after a1 , 20d + section Another + Task in sec :2014-01-12 , 12d + another task : 24d +
+

Pie Chart

+
pie title Pets adopted by volunteers + "Dogs" : 386 + "Cats" : 85 + "Rats" : 15 + +
+

ER Diagram

+
erDiagram + CUSTOMER }|..|{ DELIVERY-ADDRESS : has + CUSTOMER ||--o{ ORDER : places + CUSTOMER ||--o{ INVOICE : "liable for" + DELIVERY-ADDRESS ||--o{ ORDER : receives + INVOICE ||--|{ ORDER : covers + ORDER ||--|{ ORDER-ITEM : includes + PRODUCT-CATEGORY ||--|{ PRODUCT : contains + PRODUCT ||--o{ ORDER-ITEM : "ordered in" +
+

User Journey

+
journey + title My working day + section Go to work + Make tea: 5: Me + Go upstairs: 3: Me + Do work: 1: Me, Cat + section Go home + Go downstairs: 5: Me + Sit down: 3: Me + +
+

Git Graph

+
gitGraph + commit + commit + branch develop + checkout develop + commit + commit + checkout main + merge develop + commit + commit + +
+""" +mermaid = """

mermaid tests

+

Flowchart

+
graph TD + A[Christmas] -->|Get money| B(Go shopping) + B --> C{Let me think} + C -->|One| D[Laptop] + C -->|Two| E[iPhone] + C -->|Three| F[fa:fa-car Car] +
+

Sequence Diagrams

+
sequenceDiagram + Alice->>+John: Hello John, how are you? + Alice->>+John: John, can you hear me? + John-->>-Alice: Hi Alice, I can hear you! + John-->>-Alice: I feel great! +
+

Class Diagram

+
classDiagram + Animal <|-- Duck + Animal <|-- Fish + Animal <|-- Zebra + Animal : +int age + Animal : +String gender + Animal: +isMammal() + Animal: +mate() + class Duck{ + +String beakColor + +swim() + +quack() + } + class Fish{ + -int sizeInFeet + -canEat() + } + class Zebra{ + +bool is_wild + +run() + } +
+

State Diagram

+
stateDiagram-v2 + [*] --> Still + Still --> [*] + Still --> Moving + Moving --> Still + Moving --> Crash + Crash --> [*] +
+

Gantt Chart

+
title A Gantt Diagram + dateFormat YYYY-MM-DD + section Section + A task :a1, 2014-01-01, 30d + Another task :after a1 , 20d + section Another + Task in sec :2014-01-12 , 12d + another task : 24d +
+

Pie Chart

+
pie title Pets adopted by volunteers + "Dogs" : 386 + "Cats" : 85 + "Rats" : 15 + +
+

ER Diagram

+
erDiagram + CUSTOMER }|..|{ DELIVERY-ADDRESS : has + CUSTOMER ||--o{ ORDER : places + CUSTOMER ||--o{ INVOICE : "liable for" + DELIVERY-ADDRESS ||--o{ ORDER : receives + INVOICE ||--|{ ORDER : covers + ORDER ||--|{ ORDER-ITEM : includes + PRODUCT-CATEGORY ||--|{ PRODUCT : contains + PRODUCT ||--o{ ORDER-ITEM : "ordered in" +
+

User Journey

+
journey + title My working day + section Go to work + Make tea: 5: Me + Go upstairs: 3: Me + Do work: 1: Me, Cat + section Go home + Go downstairs: 5: Me + Sit down: 3: Me + +
+

Git Graph

+
gitGraph + commit + commit + branch develop + checkout develop + commit + commit + checkout main + merge develop + commit + commit + +
+""" diff --git a/tests/data/markdown/vega-lite.toml b/tests/data/markdown/vega-lite.toml new file mode 100644 index 000000000..87ab709fd --- /dev/null +++ b/tests/data/markdown/vega-lite.toml @@ -0,0 +1,1369 @@ +markdown = """ +# vega-lite tests + +## Interactive Scatter Plot Matrix + +``` { vega-lite } +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "repeat": { + "row": ["Horsepower", "Acceleration", "Miles_per_Gallon"], + "column": ["Miles_per_Gallon", "Acceleration", "Horsepower"] + }, + "spec": { + "data": {"url": "https://vega.github.io/vega-lite/examples/data/cars.json"}, + "mark": "point", + "params": [ + { + "name": "brush", + "select": { + "type": "interval", + "resolve": "union", + "on": "[mousedown[event.shiftKey], window:mouseup] > window:mousemove!", + "translate": "[mousedown[event.shiftKey], window:mouseup] > window:mousemove!", + "zoom": "wheel![event.shiftKey]" + } + }, + { + "name": "grid", + "select": { + "type": "interval", + "resolve": "global", + "translate": "[mousedown[!event.shiftKey], window:mouseup] > window:mousemove!", + "zoom": "wheel![!event.shiftKey]" + }, + "bind": "scales" + } + ], + "encoding": { + "x": {"field": {"repeat": "column"}, "type": "quantitative"}, + "y": { + "field": {"repeat": "row"}, + "type": "quantitative", + "axis": {"minExtent": 30} + }, + "color": { + "condition": { + "param": "brush", + "field": "Origin", + "type": "nominal" + }, + "value": "grey" + } + } + } +} +``` + +## Population Pyramid + +```{vega-lite} +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "A population pyramid for the US in 2000.", + "data": { "url": "https://vega.github.io/vega-lite/examples/data/population.json"}, + "transform": [ + {"filter": "datum.year == 2000"}, + {"calculate": "datum.sex == 2 ? 'Female' : 'Male'", "as": "gender"} + ], + "spacing": 0, + "hconcat": [{ + "transform": [{ + "filter": {"field": "gender", "equal": "Female"} + }], + "title": "Female", + "mark": "bar", + "encoding": { + "y": { + "field": "age", "axis": null, "sort": "descending" + }, + "x": { + "aggregate": "sum", "field": "people", + "title": "population", + "axis": {"format": "s"}, + "sort": "descending" + }, + "color": { + "field": "gender", + "scale": {"range": ["#675193", "#ca8861"]}, + "legend": null + } + } + }, { + "width": 20, + "view": {"stroke": null}, + "mark": { + "type": "text", + "align": "center" + }, + "encoding": { + "y": {"field": "age", "type": "ordinal", "axis": null, "sort": "descending"}, + "text": {"field": "age", "type": "quantitative"} + } + }, { + "transform": [{ + "filter": {"field": "gender", "equal": "Male"} + }], + "title": "Male", + "mark": "bar", + "encoding": { + "y": { + "field": "age", "title": null, + "axis": null, "sort": "descending" + }, + "x": { + "aggregate": "sum", "field": "people", + "title": "population", + "axis": {"format": "s"} + }, + "color": { + "field": "gender", + "legend": null + } + } + }], + "config": { + "view": {"stroke": null}, + "axis": {"grid": false} + } +} + +``` + +## Discretizing scales + +``` {vega-lite} +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "Horizontally concatenated charts that show different types of discretizing scales.", + "data": { + "values": [ + {"a": "A", "b": 28}, + {"a": "B", "b": 55}, + {"a": "C", "b": 43}, + {"a": "D", "b": 91}, + {"a": "E", "b": 81}, + {"a": "F", "b": 53}, + {"a": "G", "b": 19}, + {"a": "H", "b": 87}, + {"a": "I", "b": 52} + ] + }, + "hconcat": [ + { + "mark": "circle", + "encoding": { + "y": { + "field": "b", + "type": "nominal", + "sort": null, + "axis": { + "ticks": false, + "domain": false, + "title": null + } + }, + "size": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "quantize" + } + }, + "color": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "quantize", + "zero": true + }, + "legend": { + "title": "Quantize" + } + } + } + }, + { + "mark": "circle", + "encoding": { + "y": { + "field": "b", + "type": "nominal", + "sort": null, + "axis": { + "ticks": false, + "domain": false, + "title": null + } + }, + "size": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "quantile", + "range": [80, 160, 240, 320, 400] + } + }, + "color": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "quantile", + "scheme": "magma" + }, + "legend": { + "format": "d", + "title": "Quantile" + } + } + } + }, + { + "mark": "circle", + "encoding": { + "y": { + "field": "b", + "type": "nominal", + "sort": null, + "axis": { + "ticks": false, + "domain": false, + "title": null + } + }, + "size": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "threshold", + "domain": [30, 70], + "range": [80, 200, 320] + } + }, + "color": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "threshold", + "domain": [30, 70], + "scheme": "viridis" + }, + "legend": { + "title": "Threshold" + } + } + } + } + ], + "resolve": { + "scale": { + "color": "independent", + "size": "independent" + } + } +} +``` + +## Marginal Histograms + +``` {vega-lite} +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "data": {"url": "https://vega.github.io/vega-lite/examples/data/movies.json"}, + "spacing": 15, + "bounds": "flush", + "vconcat": [{ + "mark": "bar", + "height": 60, + "encoding": { + "x": { + "bin": true, + "field": "IMDB Rating", + "axis": null + }, + "y": { + "aggregate": "count", + "scale": { + "domain": [0,1000] + }, + "title": "" + } + } + }, { + "spacing": 15, + "bounds": "flush", + "hconcat": [{ + "mark": "rect", + "encoding": { + "x": {"bin": true, "field": "IMDB Rating"}, + "y": {"bin": true, "field": "Rotten Tomatoes Rating"}, + "color": {"aggregate": "count"} + } + }, { + "mark": "bar", + "width": 60, + "encoding": { + "y": { + "bin": true, + "field": "Rotten Tomatoes Rating", + "axis": null + }, + "x": { + "aggregate": "count", + "scale": {"domain": [0,1000]}, + "title": "" + } + } + }] + }], + "config": { + "view": { + "stroke": "transparent" + } + } +} +``` + +## Radial Plot + +``` {vega-lite} +{ + "$schema": "https://vega.github.io/schema/vega-lite/v5.json", + "description": "A simple radial chart with embedded data.", + "data": { + "values": [12, 23, 47, 6, 52, 19] + }, + "layer": [{ + "mark": {"type": "arc", "innerRadius": 20, "stroke": "#fff"} + },{ + "mark": {"type": "text", "radiusOffset": 10}, + "encoding": { + "text": {"field": "data", "type": "quantitative"} + } + }], + "encoding": { + "theta": {"field": "data", "type": "quantitative", "stack": true}, + "radius": {"field": "data", "scale": {"type": "sqrt", "zero": true, "rangeMin": 20}}, + "color": {"field": "data", "type": "nominal", "legend": null} + } +} + +``` +""" + +[config] +profiles = [ "basic", "document",] + +[config.custom_profiles.markmap] +args_config = "default" +plugins = [ "vega-lite",] + +[expected_output] +basic = """

vega-lite tests

+

Interactive Scatter Plot Matrix

+
{
+  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
+  "repeat": {
+    "row": ["Horsepower", "Acceleration", "Miles_per_Gallon"],
+    "column": ["Miles_per_Gallon", "Acceleration", "Horsepower"]
+  },
+  "spec": {
+    "data": {"url": "https://vega.github.io/vega-lite/examples/data/cars.json"},
+    "mark": "point",
+    "params": [
+      {
+        "name": "brush",
+        "select": {
+          "type": "interval",
+          "resolve": "union",
+          "on": "[mousedown[event.shiftKey], window:mouseup] > window:mousemove!",
+          "translate": "[mousedown[event.shiftKey], window:mouseup] > window:mousemove!",
+          "zoom": "wheel![event.shiftKey]"
+        }
+      },
+      {
+        "name": "grid",
+        "select": {
+          "type": "interval",
+          "resolve": "global",
+          "translate": "[mousedown[!event.shiftKey], window:mouseup] > window:mousemove!",
+          "zoom": "wheel![!event.shiftKey]"
+        },
+        "bind": "scales"
+      }
+    ],
+    "encoding": {
+      "x": {"field": {"repeat": "column"}, "type": "quantitative"},
+      "y": {
+        "field": {"repeat": "row"},
+        "type": "quantitative",
+        "axis": {"minExtent": 30}
+      },
+      "color": {
+        "condition": {
+          "param": "brush",
+          "field": "Origin",
+          "type": "nominal"
+        },
+        "value": "grey"
+      }
+    }
+  }
+}
+
+

Population Pyramid

+
{
+  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
+  "description": "A population pyramid for the US in 2000.",
+  "data": { "url": "https://vega.github.io/vega-lite/examples/data/population.json"},
+  "transform": [
+    {"filter": "datum.year == 2000"},
+    {"calculate": "datum.sex == 2 ? 'Female' : 'Male'", "as": "gender"}
+  ],
+  "spacing": 0,
+  "hconcat": [{
+    "transform": [{
+      "filter": {"field": "gender", "equal": "Female"}
+    }],
+    "title": "Female",
+    "mark": "bar",
+    "encoding": {
+      "y": {
+        "field": "age", "axis": null, "sort": "descending"
+      },
+      "x": {
+        "aggregate": "sum", "field": "people",
+        "title": "population",
+        "axis": {"format": "s"},
+        "sort": "descending"
+      },
+      "color": {
+        "field": "gender",
+        "scale": {"range": ["#675193", "#ca8861"]},
+        "legend": null
+      }
+    }
+  }, {
+    "width": 20,
+    "view": {"stroke": null},
+    "mark": {
+      "type": "text",
+      "align": "center"
+    },
+    "encoding": {
+      "y": {"field": "age", "type": "ordinal", "axis": null, "sort": "descending"},
+      "text": {"field": "age", "type": "quantitative"}
+    }
+  }, {
+    "transform": [{
+      "filter": {"field": "gender", "equal": "Male"}
+    }],
+    "title": "Male",
+    "mark": "bar",
+    "encoding": {
+      "y": {
+        "field": "age", "title": null,
+        "axis": null, "sort": "descending"
+      },
+      "x": {
+        "aggregate": "sum", "field": "people",
+        "title": "population",
+        "axis": {"format": "s"}
+      },
+      "color": {
+        "field": "gender",
+        "legend": null
+      }
+    }
+  }],
+  "config": {
+    "view": {"stroke": null},
+    "axis": {"grid": false}
+  }
+}
+
+
+

Discretizing scales

+
{
+  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
+  "description": "Horizontally concatenated charts that show different types of discretizing scales.",
+  "data": {
+    "values": [
+      {"a": "A", "b": 28},
+      {"a": "B", "b": 55},
+      {"a": "C", "b": 43},
+      {"a": "D", "b": 91},
+      {"a": "E", "b": 81},
+      {"a": "F", "b": 53},
+      {"a": "G", "b": 19},
+      {"a": "H", "b": 87},
+      {"a": "I", "b": 52}
+    ]
+  },
+  "hconcat": [
+    {
+      "mark": "circle",
+      "encoding": {
+        "y": {
+          "field": "b",
+          "type": "nominal",
+          "sort": null,
+          "axis": {
+            "ticks": false,
+            "domain": false,
+            "title": null
+          }
+        },
+        "size": {
+          "field": "b",
+          "type": "quantitative",
+          "scale": {
+            "type": "quantize"
+          }
+        },
+        "color": {
+          "field": "b",
+          "type": "quantitative",
+          "scale": {
+            "type": "quantize",
+            "zero": true
+          },
+          "legend": {
+            "title": "Quantize"
+          }
+        }
+      }
+    },
+    {
+      "mark": "circle",
+      "encoding": {
+        "y": {
+          "field": "b",
+          "type": "nominal",
+          "sort": null,
+          "axis": {
+            "ticks": false,
+            "domain": false,
+            "title": null
+          }
+        },
+        "size": {
+          "field": "b",
+          "type": "quantitative",
+          "scale": {
+            "type": "quantile",
+            "range": [80, 160, 240, 320, 400]
+          }
+        },
+        "color": {
+          "field": "b",
+          "type": "quantitative",
+          "scale": {
+            "type": "quantile",
+            "scheme": "magma"
+          },
+          "legend": {
+            "format": "d",
+            "title": "Quantile"
+          }
+        }
+      }
+    },
+    {
+      "mark": "circle",
+      "encoding": {
+        "y": {
+          "field": "b",
+          "type": "nominal",
+          "sort": null,
+          "axis": {
+            "ticks": false,
+            "domain": false,
+            "title": null
+          }
+        },
+        "size": {
+          "field": "b",
+          "type": "quantitative",
+          "scale": {
+            "type": "threshold",
+            "domain": [30, 70],
+            "range": [80, 200, 320]
+          }
+        },
+        "color": {
+          "field": "b",
+          "type": "quantitative",
+          "scale": {
+            "type": "threshold",
+            "domain": [30, 70],
+            "scheme": "viridis"
+          },
+          "legend": {
+            "title": "Threshold"
+          }
+        }
+      }
+    }
+  ],
+  "resolve": {
+    "scale": {
+      "color": "independent",
+      "size": "independent"
+    }
+  }
+}
+
+

Marginal Histograms

+
{
+  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
+  "data": {"url": "https://vega.github.io/vega-lite/examples/data/movies.json"},
+  "spacing": 15,
+  "bounds": "flush",
+  "vconcat": [{
+    "mark": "bar",
+    "height": 60,
+    "encoding": {
+      "x": {
+        "bin": true,
+        "field": "IMDB Rating",
+        "axis": null
+      },
+      "y": {
+        "aggregate": "count",
+        "scale": {
+          "domain": [0,1000]
+        },
+        "title": ""
+      }
+    }
+  }, {
+    "spacing": 15,
+    "bounds": "flush",
+    "hconcat": [{
+      "mark": "rect",
+      "encoding": {
+        "x": {"bin": true, "field": "IMDB Rating"},
+        "y": {"bin": true, "field": "Rotten Tomatoes Rating"},
+        "color": {"aggregate": "count"}
+      }
+    }, {
+      "mark": "bar",
+      "width": 60,
+      "encoding": {
+        "y": {
+          "bin": true,
+          "field": "Rotten Tomatoes Rating",
+          "axis": null
+        },
+        "x": {
+          "aggregate": "count",
+          "scale": {"domain": [0,1000]},
+          "title": ""
+        }
+      }
+    }]
+  }],
+  "config": {
+    "view": {
+      "stroke": "transparent"
+    }
+  }
+}
+
+

Radial Plot

+
{
+  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
+  "description": "A simple radial chart with embedded data.",
+  "data": {
+    "values": [12, 23, 47, 6, 52, 19]
+  },
+  "layer": [{
+    "mark": {"type": "arc", "innerRadius": 20, "stroke": "#fff"}
+  },{
+    "mark": {"type": "text", "radiusOffset": 10},
+    "encoding": {
+      "text": {"field": "data", "type": "quantitative"}
+    }
+  }],
+  "encoding": {
+    "theta": {"field": "data", "type": "quantitative", "stack": true},
+    "radius": {"field": "data", "scale": {"type": "sqrt", "zero": true, "rangeMin": 20}},
+    "color": {"field": "data", "type": "nominal", "legend": null}
+  }
+}
+
+
+""" +document = """

vega-lite tests

+

Interactive Scatter Plot Matrix

+
{ +"$schema": "https://vega.github.io/schema/vega-lite/v5.json", +"repeat": { + "row": ["Horsepower", "Acceleration", "Miles_per_Gallon"], + "column": ["Miles_per_Gallon", "Acceleration", "Horsepower"] +}, +"spec": { + "data": {"url": "https://vega.github.io/vega-lite/examples/data/cars.json"}, + "mark": "point", + "params": [ + { + "name": "brush", + "select": { + "type": "interval", + "resolve": "union", + "on": "[mousedown[event.shiftKey], window:mouseup] > window:mousemove!", + "translate": "[mousedown[event.shiftKey], window:mouseup] > window:mousemove!", + "zoom": "wheel![event.shiftKey]" + } + }, + { + "name": "grid", + "select": { + "type": "interval", + "resolve": "global", + "translate": "[mousedown[!event.shiftKey], window:mouseup] > window:mousemove!", + "zoom": "wheel![!event.shiftKey]" + }, + "bind": "scales" + } + ], + "encoding": { + "x": {"field": {"repeat": "column"}, "type": "quantitative"}, + "y": { + "field": {"repeat": "row"}, + "type": "quantitative", + "axis": {"minExtent": 30} + }, + "color": { + "condition": { + "param": "brush", + "field": "Origin", + "type": "nominal" + }, + "value": "grey" + } + } +} +} +
+

Population Pyramid

+
{ +"$schema": "https://vega.github.io/schema/vega-lite/v5.json", +"description": "A population pyramid for the US in 2000.", +"data": { "url": "https://vega.github.io/vega-lite/examples/data/population.json"}, +"transform": [ + {"filter": "datum.year == 2000"}, + {"calculate": "datum.sex == 2 ? 'Female' : 'Male'", "as": "gender"} +], +"spacing": 0, +"hconcat": [{ + "transform": [{ + "filter": {"field": "gender", "equal": "Female"} + }], + "title": "Female", + "mark": "bar", + "encoding": { + "y": { + "field": "age", "axis": null, "sort": "descending" + }, + "x": { + "aggregate": "sum", "field": "people", + "title": "population", + "axis": {"format": "s"}, + "sort": "descending" + }, + "color": { + "field": "gender", + "scale": {"range": ["#675193", "#ca8861"]}, + "legend": null + } + } +}, { + "width": 20, + "view": {"stroke": null}, + "mark": { + "type": "text", + "align": "center" + }, + "encoding": { + "y": {"field": "age", "type": "ordinal", "axis": null, "sort": "descending"}, + "text": {"field": "age", "type": "quantitative"} + } +}, { + "transform": [{ + "filter": {"field": "gender", "equal": "Male"} + }], + "title": "Male", + "mark": "bar", + "encoding": { + "y": { + "field": "age", "title": null, + "axis": null, "sort": "descending" + }, + "x": { + "aggregate": "sum", "field": "people", + "title": "population", + "axis": {"format": "s"} + }, + "color": { + "field": "gender", + "legend": null + } + } +}], +"config": { + "view": {"stroke": null}, + "axis": {"grid": false} +} +} + +
+

Discretizing scales

+
{ +"$schema": "https://vega.github.io/schema/vega-lite/v5.json", +"description": "Horizontally concatenated charts that show different types of discretizing scales.", +"data": { + "values": [ + {"a": "A", "b": 28}, + {"a": "B", "b": 55}, + {"a": "C", "b": 43}, + {"a": "D", "b": 91}, + {"a": "E", "b": 81}, + {"a": "F", "b": 53}, + {"a": "G", "b": 19}, + {"a": "H", "b": 87}, + {"a": "I", "b": 52} + ] +}, +"hconcat": [ + { + "mark": "circle", + "encoding": { + "y": { + "field": "b", + "type": "nominal", + "sort": null, + "axis": { + "ticks": false, + "domain": false, + "title": null + } + }, + "size": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "quantize" + } + }, + "color": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "quantize", + "zero": true + }, + "legend": { + "title": "Quantize" + } + } + } + }, + { + "mark": "circle", + "encoding": { + "y": { + "field": "b", + "type": "nominal", + "sort": null, + "axis": { + "ticks": false, + "domain": false, + "title": null + } + }, + "size": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "quantile", + "range": [80, 160, 240, 320, 400] + } + }, + "color": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "quantile", + "scheme": "magma" + }, + "legend": { + "format": "d", + "title": "Quantile" + } + } + } + }, + { + "mark": "circle", + "encoding": { + "y": { + "field": "b", + "type": "nominal", + "sort": null, + "axis": { + "ticks": false, + "domain": false, + "title": null + } + }, + "size": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "threshold", + "domain": [30, 70], + "range": [80, 200, 320] + } + }, + "color": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "threshold", + "domain": [30, 70], + "scheme": "viridis" + }, + "legend": { + "title": "Threshold" + } + } + } + } +], +"resolve": { + "scale": { + "color": "independent", + "size": "independent" + } +} +} +
+

Marginal Histograms

+
{ +"$schema": "https://vega.github.io/schema/vega-lite/v5.json", +"data": {"url": "https://vega.github.io/vega-lite/examples/data/movies.json"}, +"spacing": 15, +"bounds": "flush", +"vconcat": [{ + "mark": "bar", + "height": 60, + "encoding": { + "x": { + "bin": true, + "field": "IMDB Rating", + "axis": null + }, + "y": { + "aggregate": "count", + "scale": { + "domain": [0,1000] + }, + "title": "" + } + } +}, { + "spacing": 15, + "bounds": "flush", + "hconcat": [{ + "mark": "rect", + "encoding": { + "x": {"bin": true, "field": "IMDB Rating"}, + "y": {"bin": true, "field": "Rotten Tomatoes Rating"}, + "color": {"aggregate": "count"} + } + }, { + "mark": "bar", + "width": 60, + "encoding": { + "y": { + "bin": true, + "field": "Rotten Tomatoes Rating", + "axis": null + }, + "x": { + "aggregate": "count", + "scale": {"domain": [0,1000]}, + "title": "" + } + } + }] +}], +"config": { + "view": { + "stroke": "transparent" + } +} +} +
+

Radial Plot

+
{ +"$schema": "https://vega.github.io/schema/vega-lite/v5.json", +"description": "A simple radial chart with embedded data.", +"data": { + "values": [12, 23, 47, 6, 52, 19] +}, +"layer": [{ + "mark": {"type": "arc", "innerRadius": 20, "stroke": "#fff"} +},{ + "mark": {"type": "text", "radiusOffset": 10}, + "encoding": { + "text": {"field": "data", "type": "quantitative"} + } +}], +"encoding": { + "theta": {"field": "data", "type": "quantitative", "stack": true}, + "radius": {"field": "data", "scale": {"type": "sqrt", "zero": true, "rangeMin": 20}}, + "color": {"field": "data", "type": "nominal", "legend": null} +} +} + +
+""" +markmap = """

vega-lite tests

+

Interactive Scatter Plot Matrix

+
{ +"$schema": "https://vega.github.io/schema/vega-lite/v5.json", +"repeat": { + "row": ["Horsepower", "Acceleration", "Miles_per_Gallon"], + "column": ["Miles_per_Gallon", "Acceleration", "Horsepower"] +}, +"spec": { + "data": {"url": "https://vega.github.io/vega-lite/examples/data/cars.json"}, + "mark": "point", + "params": [ + { + "name": "brush", + "select": { + "type": "interval", + "resolve": "union", + "on": "[mousedown[event.shiftKey], window:mouseup] > window:mousemove!", + "translate": "[mousedown[event.shiftKey], window:mouseup] > window:mousemove!", + "zoom": "wheel![event.shiftKey]" + } + }, + { + "name": "grid", + "select": { + "type": "interval", + "resolve": "global", + "translate": "[mousedown[!event.shiftKey], window:mouseup] > window:mousemove!", + "zoom": "wheel![!event.shiftKey]" + }, + "bind": "scales" + } + ], + "encoding": { + "x": {"field": {"repeat": "column"}, "type": "quantitative"}, + "y": { + "field": {"repeat": "row"}, + "type": "quantitative", + "axis": {"minExtent": 30} + }, + "color": { + "condition": { + "param": "brush", + "field": "Origin", + "type": "nominal" + }, + "value": "grey" + } + } +} +} +
+

Population Pyramid

+
{ +"$schema": "https://vega.github.io/schema/vega-lite/v5.json", +"description": "A population pyramid for the US in 2000.", +"data": { "url": "https://vega.github.io/vega-lite/examples/data/population.json"}, +"transform": [ + {"filter": "datum.year == 2000"}, + {"calculate": "datum.sex == 2 ? 'Female' : 'Male'", "as": "gender"} +], +"spacing": 0, +"hconcat": [{ + "transform": [{ + "filter": {"field": "gender", "equal": "Female"} + }], + "title": "Female", + "mark": "bar", + "encoding": { + "y": { + "field": "age", "axis": null, "sort": "descending" + }, + "x": { + "aggregate": "sum", "field": "people", + "title": "population", + "axis": {"format": "s"}, + "sort": "descending" + }, + "color": { + "field": "gender", + "scale": {"range": ["#675193", "#ca8861"]}, + "legend": null + } + } +}, { + "width": 20, + "view": {"stroke": null}, + "mark": { + "type": "text", + "align": "center" + }, + "encoding": { + "y": {"field": "age", "type": "ordinal", "axis": null, "sort": "descending"}, + "text": {"field": "age", "type": "quantitative"} + } +}, { + "transform": [{ + "filter": {"field": "gender", "equal": "Male"} + }], + "title": "Male", + "mark": "bar", + "encoding": { + "y": { + "field": "age", "title": null, + "axis": null, "sort": "descending" + }, + "x": { + "aggregate": "sum", "field": "people", + "title": "population", + "axis": {"format": "s"} + }, + "color": { + "field": "gender", + "legend": null + } + } +}], +"config": { + "view": {"stroke": null}, + "axis": {"grid": false} +} +} + +
+

Discretizing scales

+
{ +"$schema": "https://vega.github.io/schema/vega-lite/v5.json", +"description": "Horizontally concatenated charts that show different types of discretizing scales.", +"data": { + "values": [ + {"a": "A", "b": 28}, + {"a": "B", "b": 55}, + {"a": "C", "b": 43}, + {"a": "D", "b": 91}, + {"a": "E", "b": 81}, + {"a": "F", "b": 53}, + {"a": "G", "b": 19}, + {"a": "H", "b": 87}, + {"a": "I", "b": 52} + ] +}, +"hconcat": [ + { + "mark": "circle", + "encoding": { + "y": { + "field": "b", + "type": "nominal", + "sort": null, + "axis": { + "ticks": false, + "domain": false, + "title": null + } + }, + "size": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "quantize" + } + }, + "color": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "quantize", + "zero": true + }, + "legend": { + "title": "Quantize" + } + } + } + }, + { + "mark": "circle", + "encoding": { + "y": { + "field": "b", + "type": "nominal", + "sort": null, + "axis": { + "ticks": false, + "domain": false, + "title": null + } + }, + "size": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "quantile", + "range": [80, 160, 240, 320, 400] + } + }, + "color": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "quantile", + "scheme": "magma" + }, + "legend": { + "format": "d", + "title": "Quantile" + } + } + } + }, + { + "mark": "circle", + "encoding": { + "y": { + "field": "b", + "type": "nominal", + "sort": null, + "axis": { + "ticks": false, + "domain": false, + "title": null + } + }, + "size": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "threshold", + "domain": [30, 70], + "range": [80, 200, 320] + } + }, + "color": { + "field": "b", + "type": "quantitative", + "scale": { + "type": "threshold", + "domain": [30, 70], + "scheme": "viridis" + }, + "legend": { + "title": "Threshold" + } + } + } + } +], +"resolve": { + "scale": { + "color": "independent", + "size": "independent" + } +} +} +
+

Marginal Histograms

+
{ +"$schema": "https://vega.github.io/schema/vega-lite/v5.json", +"data": {"url": "https://vega.github.io/vega-lite/examples/data/movies.json"}, +"spacing": 15, +"bounds": "flush", +"vconcat": [{ + "mark": "bar", + "height": 60, + "encoding": { + "x": { + "bin": true, + "field": "IMDB Rating", + "axis": null + }, + "y": { + "aggregate": "count", + "scale": { + "domain": [0,1000] + }, + "title": "" + } + } +}, { + "spacing": 15, + "bounds": "flush", + "hconcat": [{ + "mark": "rect", + "encoding": { + "x": {"bin": true, "field": "IMDB Rating"}, + "y": {"bin": true, "field": "Rotten Tomatoes Rating"}, + "color": {"aggregate": "count"} + } + }, { + "mark": "bar", + "width": 60, + "encoding": { + "y": { + "bin": true, + "field": "Rotten Tomatoes Rating", + "axis": null + }, + "x": { + "aggregate": "count", + "scale": {"domain": [0,1000]}, + "title": "" + } + } + }] +}], +"config": { + "view": { + "stroke": "transparent" + } +} +} +
+

Radial Plot

+
{ +"$schema": "https://vega.github.io/schema/vega-lite/v5.json", +"description": "A simple radial chart with embedded data.", +"data": { + "values": [12, 23, 47, 6, 52, 19] +}, +"layer": [{ + "mark": {"type": "arc", "innerRadius": 20, "stroke": "#fff"} +},{ + "mark": {"type": "text", "radiusOffset": 10}, + "encoding": { + "text": {"field": "data", "type": "quantitative"} + } +}], +"encoding": { + "theta": {"field": "data", "type": "quantitative", "stack": true}, + "radius": {"field": "data", "scale": {"type": "sqrt", "zero": true, "rangeMin": 20}}, + "color": {"field": "data", "type": "nominal", "legend": null} +} +} + +
+"""