Scatterternary
Overview
The scatterternary insight type is used to create scatter plots on ternary plots, which visualize proportions of three components that sum to a constant. It is ideal for fields like chemistry, soil science, and economics to explore relationships between three interdependent variables.
You can customize marker size, color, and lines to connect points, similar to scatter plots but within a ternary coordinate system.
Common Uses
- Proportional Data Visualization: Visualizing data involving three interdependent components.
- Ternary Relationship Analysis: Exploring how three components relate to one another.
- Chemistry and Economics: Useful for compositional data visualization.
Check out the Attributes for the full set of configuration options
Examples
Common Configurations
sources:
- name: scatterternary-data-source
type: duckdb
database: target/seeds/scatterternary_data.duckdb
seeds:
- table_name: model
args:
- echo
- |
a,b,c
0.1,0.5,0.4
0.3,0.4,0.3
0.5,0.3,0.2
0.7,0.2,0.1
models:
- name: scatterternary-data
source: ${ref(scatterternary-data-source)}
sql: select * from model
insights:
- name: Simple Scatterternary Insight
props:
type: scatterternary
a: ?{${ref(scatterternary-data).a}}
b: ?{${ref(scatterternary-data).b}}
c: ?{${ref(scatterternary-data).c}}
mode: "markers"
interactions:
- split: ?{ a }
- split: ?{ b }
- split: ?{ c }
charts:
- name: Simple Scatterternary Chart
insights:
- ${ref(Simple Scatterternary Insight)}
layout:
title:
text: Simple Scatterternary Plot<br><sub>Data Points on a Ternary Plot</sub>
sources:
- name: scatterternary-data-lines-source
type: duckdb
database: target/seeds/scatterternary_data_lines.duckdb
seeds:
- table_name: model
args:
- echo
- |
a,b,c
0.2,0.6,0.2
0.4,0.3,0.3
0.6,0.2,0.2
0.8,0.1,0.1
models:
- name: scatterternary-data-lines
source: ${ref(scatterternary-data-lines-source)}
sql: select * from model
insights:
- name: Scatterternary Insight with Lines
props:
type: scatterternary
a: ?{${ref(scatterternary-data-lines).a}}
b: ?{${ref(scatterternary-data-lines).b}}
c: ?{${ref(scatterternary-data-lines).c}}
mode: "lines+markers"
interactions:
- split: ?{ a }
- split: ?{ b }
- split: ?{ c }
charts:
- name: Scatterternary Chart with Lines
insights:
- ${ref(Scatterternary Insight with Lines)}
layout:
title:
text: Scatterternary Plot with Lines<br><sub>Connecting Data Points on a Ternary Plot</sub>
sources:
- name: scatterternary-data-custom-source
type: duckdb
database: target/seeds/scatterternary_data_custom.duckdb
seeds:
- table_name: model
args:
- echo
- |
a,b,c,size,color
0.1,0.5,0.4,10,#1f77b4
0.3,0.4,0.3,15,#ff7f0e
0.5,0.3,0.2,20,#2ca02c
0.7,0.2,0.1,25,#d62728
models:
- name: scatterternary-data-custom
source: ${ref(scatterternary-data-custom-source)}
sql: select * from model
insights:
- name: Scatterternary Insight with Custom Markers
props:
type: scatterternary
a: ?{${ref(scatterternary-data-custom).a}}
b: ?{${ref(scatterternary-data-custom).b}}
c: ?{${ref(scatterternary-data-custom).c}}
mode: "markers"
marker:
size: ?{${ref(scatterternary-data-custom).size}}
color: ?{${ref(scatterternary-data-custom).color}}
interactions:
- split: ?{ a }
- split: ?{ b }
- split: ?{ c }
- split: ?{ color }
charts:
- name: Scatterternary Chart with Custom Markers
insights:
- ${ref(Scatterternary Insight with Custom Markers)}
layout:
title:
text: Scatterternary Plot with Custom Markers<br><sub>Custom Sizes and Colors for Ternary Data Points</sub>