Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify Label Width for Facet #3195

Closed
curran opened this issue Nov 9, 2017 · 1 comment
Closed

Specify Label Width for Facet #3195

curran opened this issue Nov 9, 2017 · 1 comment

Comments

@curran
Copy link

curran commented Nov 9, 2017

This is perhaps an issue where it's configurable already, but I just cannot find the way to configure it.

The issue is, I'd like to allocate more space for the labels of cities here, so the city names don't get truncated:

image

This is the spec I have:

{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "width": 805,
  "height": 52,
  "data": {
      "url": "data.csv"
  },
  "mark": "area",
  "encoding": {
      "x": {
          "field": "timestamp",
          "type": "temporal",
          "axis": {
              "title": "Time",
              "grid": false
          }
      },
      "y": {
          "field": "temperature",
          "type": "quantitative",
          "axis": {
              "title": "Temp °C",
              "grid": false
          }
      },
      "color": {
          "field": "city",
          "type": "nominal",
          "legend": null
      },
      "row": {
          "field": "city",
          "type": "nominal",
          "header": {"title": "City"}
      }
  }
}

You can see it running here: https://datavis.tech/edit/5a391ee51b1043c5ac7c8cb1fd0249e7

I've looked in the following places in the documentation to see if the label spacing is configurable:

The closest thing I've found so far is titleMaxLength for Axis, but I don't think that's the thing to configure for these labels.

Fingers crossed this is something easy to do already :)

Thanks for the great ongoing work!

@kanitw
Copy link
Member

kanitw commented Nov 18, 2017

Thanks for asking!

The underlying Vega may have an unintended text limit set -- please follow the issue that I have filed here.

In any case, I agree you should be able to adjust the underlying labelLimit, but we haven't implement it yet (as noted in #2446).

I'm gonna close this issue now as we have tracked both issues. Note that I have listed some instruction in the first part #2446 if you want to help contribute support for header label and title properties.

@kanitw kanitw closed this as completed Nov 18, 2017
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

No branches or pull requests

2 participants