Skip to content

add support for YAML or JSON#1

Open
mikesmullin wants to merge 1 commit intoFlomoN:masterfrom
mikesmullin:features/add-yaml-support
Open

add support for YAML or JSON#1
mikesmullin wants to merge 1 commit intoFlomoN:masterfrom
mikesmullin:features/add-yaml-support

Conversation

@mikesmullin
Copy link

Description

I think YAML is easier than JSON5, and I'd like the option to use either.

Test Case

Example using JS

{
  "type": "pie",
  "data": {
    "labels": [
      "Red",
      "Blue",
      "Yellow"
    ],
    "datasets": [
      {
        "data": [
          300,
          50,
          100
        ],
        "backgroundColor": [
          "#FF6384",
          "#36A2EB",
          "#FFCE56"
        ],
        "hoverBackgroundColor": [
          "#FF6384",
          "#36A2EB",
          "#FFCE56"
        ]
      }
    ]
  },
  "options": {}
}

Example using YAML

type: pie
data:
  labels:
  - Red
  - Blue
  - Yellow
  datasets:
  - data:
    - 300
    - 50
    - 100
    backgroundColor:
    - "#FF6384"
    - "#36A2EB"
    - "#FFCE56"
    hoverBackgroundColor:
    - "#FF6384"
    - "#36A2EB"
    - "#FFCE56"
options: {}

"@types/node": "^7.0.43",
"typescript": "^2.6.1",
"vscode": "^1.1.6"
"vscode": "^1.1.37"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was necessary to launch & debug for me.

@mikesmullin
Copy link
Author

mikesmullin commented Aug 8, 2023

Another example, from: https://www.chartjs.org/docs/latest/charts/line.html
See also: https://yaml.org/spec/1.2.0/#Preview

type: line
data:
  labels: [Jan, Feb, Mar, Apr, May, Jun, Jul]
  datasets:
  -
    label: My First Dataset
    data: [65, 59, 80, 81, 56, 55, 40]
    fill: false
    borderColor: rgb(75, 192, 192)
    tension: 0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant