Giter VIP home page Giter VIP logo

Comments (1)

agateblue avatar agateblue commented on June 9, 2024

Hi @dskrad, thank you for opening the issue. Until this is properly documented, you can find below a custom blueprint I have that includes visualizations:

{
  "id": "agate:travel",
  "label": "Travel",
  "title": "Forms and visualizations for your trips",
  "version": "1",
  "fields": [
    {
      "id": "travel:distance",
      "label": "Distance",
      "unit": "Kilometers",
      "type": "number",
      "min": 0
    },
    {
      "id": "travel:from",
      "label": "Place of departure",
      "type": "text"
    },
    {
      "id": "travel:to",
      "label": "Destination",
      "type": "text"
    },
    {
      "id": "travel:by",
      "label": "Transport",
      "type": "text"
    }
  ],
  "forms": [
    {
      "id": "travel:trip",
      "label": "Trip",
      "fields": [
        {
          "id": "travel:from"
        },
        {
          "id": "travel:to"
        },
        {
          "id": "travel:distance"
        },
        {
          "id": "travel:by"
        }
      ]
    }
  ],
  "visualizations": [
    {
      "label": "Travel distance",
      "help": "In kilometers",
      "query": "SELECT date, sum(CASE WHEN data->`travel:distance` > 0 THEN data->`travel:distance` ELSE 0 END) as Distance FROM ? GROUP BY date ORDER BY date DESC",
      "displayType": "bar",
      "displayOptions": {
        "colors": [
          "green"
        ]
      }
    },
    {
      "label": "Means of transportation",
      "help": "In kilometers",
      "query": "SELECT data->`travel:by`, sum(data->`travel:distance`) as Distance FROM ? GROUP BY data->`travel:by` ORDER BY date DESC",
      "displayType": "pie",
      "displayOptions": {}
    },
    {
      "label": "Travels by distance and destination",
      "help": "In kilometers",
      "query": "SELECT data->`travel:from` as `From`, data->`travel:to` as `To`, sum(data->`travel:distance`) as Distance FROM ? GROUP BY data->`travel:from`, data->`travel:to` ORDER BY Distance DESC",
      "displayType": "table",
      "displayOptions": {}
    }
  ]
}

Hopefully, it can help you getting started.

from tempo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.