Esri / Esri/cedar

Errors when removing axes property from specification

Open
#168 3 comments 0 reactions 1 assignee Claimed by @ajturner View on GitHub
in progress v0x
Dominant language
Handlebars
Stars
265
Forks
236
PR merge metrics
No merged PRs in 30d

Description

I think axes should be optional, I believe they are in vega? Trying to figure out how to remove them as they're adding a bunch of padding I don't want/can't have when creating a very small chart. Currently if I remove "axes" from the spec, I get an error. I set `fontSize` to 0 which got rid of the text, but there's still a lot of padding around the axes that I can't seem to get rid of:

![opendata_-_tng](https://cloud.githubusercontent.com/assets/910495/10375062/a6b4083a-6db3-11e5-9919-b5a208ac60b3.jpg)

Here's my spec:

```
{
"inputs": [
{ "name": "x", "type": [ "string" ], "required": false },
{ "name": "y", "type": [ "numeric" ], "required": false }
],
"query": {},
"template":{
"axes": [
{
"type": "x",
"scale": "x",
"titleOffset": 0,
"title": "{x.label}",
"properties": {
"title": {
"fontSize": {"value": 0},
"fill": {"value": "#999"},
"fontWeight": {"value": "normal"}
},
"axis": {
"stroke": {"value": "#dbdad9"},
"strokeWidth": {"value": 1.5}
},
"ticks": {
"stroke": {"value": "#dbdad9"}
},
"labels": {
"fill": {"value": "#999"},
"angle": {"value": -50},
"fontSize": {"value": 0},
"align": {"value": "right"},
"baseline": {"value": "middle"}
}
}
},
{
"type": "y",
"scale": "y",
"titleOffset": 0,
"title": "{y.label}",
"properties": {
"title": {
"fontSize": {"value": 0},
"fill": {"value": "#999"},
"fontWeight": {"value": "normal"}
},
"axis": {
"stroke": {"value": "#dbdad9"},
"strokeWidth": {"value": 1.5}
},
"ticks": {
"stroke": {"value": "#dbdad9"}
},
"labels": {
"fill": {"value": "#999"},
"fontSize": {"value": 0}
}
}
}
],
"data": [
{
"name": "table",
"format": {"property": "features"}
}
],
"marks": [
{
"from": {"data": "table"},
"properties": {
"enter": {
},
"update": {
"width": {"band": true, "offset": -1, "scale": "x"},
"x": {"field": "attributes.{x.field}", "scale": "x"},
"y": {"field": "attributes.{y.field}", "scale": "y"},
"y2": {"scale": "y", "value": 0 },
"fill": {"value": "#0079c1"}
},
"hover": {
"fill": {"value": "#29b6ea"}
}
},
"type": "rect"
}
],
"scales": [
{
"domain": {
"data": "table",
"field": "attributes.{x.field}"
},
"name": "x",
"range": "width",
"type": "ordinal",
"padding": 0
},
{
"domain": {
"data": "table",
"field": "attributes.{y.field}"
},
"name": "y",
"nice": true,
"range": "height"
}
]
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.