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

Duplicate titles under facet #5432

Closed
buckle2000 opened this issue Oct 3, 2019 · 9 comments
Closed

Duplicate titles under facet #5432

buckle2000 opened this issue Oct 3, 2019 · 9 comments
Labels
Need Clarification ❔ Needs clarification before we can proceed.

Comments

@buckle2000
Copy link

buckle2000 commented Oct 3, 2019

The example and schema are here

Note in the screenshot below, each column/row has its own title. I think each row should share one title.

screenshot

{
  data: {values: data},
  facet: {column: {field: 'i', title: 'arm', type: 'ordinal'}},
  width,
  spec: {    
    vconcat: [{
      title: 'Expectations',
      layer: [{
        width: 180,
        mark: 'area',
        encoding: {
          x: {field:'x', title: 'proportion'},
          y: {field:'y', title: 'probability density'},
          opacity: {value:0.1},
        },
      }, {
        mark: 'rule',
        encoding: {
          x: {field: 'p'},
        },
      }]
    }, {
      title: 'Outcomes',
      mark: 'bar',
      encoding: {
        x: {field:'name', type:'nominal', title:null},
        y: {field:'count', type:'quantitative'},
      }
    }]
  }
}

P.S. I also ran into #4680 and #5219 in that working example

@domoritz
Copy link
Member

domoritz commented Oct 3, 2019

This is expected behavior since the title is set for each layered chart.

@domoritz domoritz closed this as completed Oct 3, 2019
@buckle2000
Copy link
Author

buckle2000 commented Oct 3, 2019

How can I set title for each row then? As in #4680? I might try to fix that myself.

@domoritz
Copy link
Member

domoritz commented Oct 3, 2019

I'm not sure I understand. Can you be specific about what you want? A sketch would help me answer your question.

@buckle2000
Copy link
Author

buckle2000 commented Oct 4, 2019

Sorry for being unclear. I meant using a spec like concat: [facet: {title: ...}, facet, {title: ...}] to only show one title for each row. However, a specification like that will error out (as in #4680 and here).

@domoritz
Copy link
Member

domoritz commented Oct 5, 2019

Ahh, I see. Can you create a minimal example that reproduces the problem in the editor?

@domoritz domoritz added the Need Clarification ❔ Needs clarification before we can proceed. label Oct 5, 2019
@domoritz domoritz reopened this Oct 5, 2019
@buckle2000
Copy link
Author

buckle2000 commented Oct 14, 2019

If you mean the problem of duplicate titles, here's an example in the editor.

@domoritz
Copy link
Member

The repeated titles are expected behavior. The spec is asking for a repeat inside a facet. The individual views do not have access to their parents and therefore the titles need to be repeated. Also note that we do not yet officially support repeat inside facet.

If you want a single title per row, use vconcat with facet.

image

https://vega.github.io/editor/#/url/vega-lite/N4KABGBEAkDODGALApgWwIaQFxUQFzwAdYsB6UgN2QHN0A6agSz0QFcAjOxge1IRQyUa6ALQAbZskoAWOgCtY3AHaQANOCgATZAgBOjQnh4qckAKIAPdKkJjkYAGbddYfERLkmLDnXjdUQrSBohJ4UoywsKw6pACs0gDMAExqGpCa6HiYOMCQFOhi0bDYYADaudlQAIJqUOwlSQAcAL6qYBUlkABCtZD1OLGxzQC6rWkUfkrwmSWlGhCgEEtQRnh2nQAqzHaOzo6MurB4YLrcAO6pyxCQDujwyHgluQ6MyGKanZhtkHgAnoTITrOTSMJQFSBjK5QWAA+BPSAYXQAa067HQugh8zAkKWiyuP22gNMWzW9icLlgyEmmhO50u+Nu90eORur3en16fwBQN0ILBYgh6ihkBhVPhiJRpjRGOaWNlEGGIGaQA

I hope that help.

@buckle2000
Copy link
Author

Thanks, but facet inside vconcat is broken (editor link). Can you point me towards fixing this?

@domoritz
Copy link
Member

Ahh, that's a bug. I filed this as a new issue at #5475. Thanks for the small example!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Need Clarification ❔ Needs clarification before we can proceed.
Projects
None yet
Development

No branches or pull requests

2 participants