Skip to content

Surface

Overview

The surface insight type is used to create 3D surface plots, visualizing the relationship between three variables on a continuous surface. Surface insights are ideal for exploring how two independent variables interact to affect a dependent variable.

You can customize the colorscale, lighting, and contours to represent your 3D data effectively.

Common Uses

  • 3D Data Visualization: Showing relationships between three variables.
  • Topographical Maps: Representing elevation or landscape contours.
  • 3D Heatmaps: Visualizing intensity or magnitude variations in three dimensions.

Check out the Attributes for the full set of configuration options

Examples

Common Configurations

sources:
  - name: surface-data-source
    type: duckdb
    database: target/seeds/surface_data.duckdb
    seeds:
      - table_name: model
        args:
          - echo
          - |
            x,y,z
            1,1,1
            1,2,2
            1,3,3
            2,1,4
            2,2,5
            2,3,6
            3,1,7
            3,2,8
            3,3,9
models:
  - name: surface-data
    source: ${ref(surface-data-source)}
    sql: select * from model
insights:
  - name: Simple Surface Insight
    props:
      type: surface
      x: ?{${ref(surface-data).x}}
      y: ?{${ref(surface-data).y}}
      z: ?{${ref(surface-data).z}}
charts:
  - name: Simple Surface Chart
    insights:
      - ${ref(Simple Surface Insight)}
    layout:
      title:
        text: Simple Surface Plot<br><sub>3D Surface Visualization</sub>
sources:
  - name: surface-data-colorscale-source
    type: duckdb
    database: target/seeds/surface_data_colorscale.duckdb
    seeds:
      - table_name: model
        args:
          - echo
          - |
            x,y,z
            1,1,1
            1,2,2
            1,3,3
            2,1,4
            2,2,5
            2,3,6
            3,1,7
            3,2,8
            3,3,9
models:
  - name: surface-data-colorscale
    source: ${ref(surface-data-colorscale-source)}
    sql: select * from model
insights:
  - name: Surface Insight with Custom Colorscale
    props:
      type: surface
      x: ?{${ref(surface-data-colorscale).x}}
      y: ?{${ref(surface-data-colorscale).y}}
      z: ?{${ref(surface-data-colorscale).z}}
      colorscale: "Viridis"
charts:
  - name: Surface Chart with Custom Colorscale
    insights:
      - ${ref(Surface Insight with Custom Colorscale)}
    layout:
      title:
        text: Surface Plot with Custom Colorscale<br><sub>Custom Colorscale for 3D Surface</sub>
sources:
  - name: surface-data-contours-source
    type: duckdb
    database: target/seeds/surface_data_contours.duckdb
    seeds:
      - table_name: model
        args:
          - echo
          - |
            x,y,z
            1,1,1
            1,2,2
            1,3,3
            2,1,4
            2,2,5
            2,3,6
            3,1,7
            3,2,8
            3,3,9
models:
  - name: surface-data-contours
    source: ${ref(surface-data-contours-source)}
    sql: select * from model
insights:
  - name: Surface Insight with Contours
    props:
      type: surface
      x: ?{${ref(surface-data-contours).x}}
      y: ?{${ref(surface-data-contours).y}}
      z: ?{${ref(surface-data-contours).z}}
      contours:
        z:
          show: true
          usecolormap: true
          highlightcolor: "#ff0000"
charts:
  - name: Surface Chart with Contours
    insights:
      - ${ref(Surface Insight with Contours)}
    layout:
      title:
        text: Surface Plot with Contours<br><sub>3D Surface with Contour Lines</sub>