Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
patBear
Helper I
Helper I

Deneb - Trellis of Trellis

Is it possible to make a trellis of a trellis in Deneb?  To help illustrate, I'll use the movie dataset as a sample along with this code.  I get a warning in Deneb though a visual does render.  In the visual, I have big gaps between Major Genres that may represent missing Genre-CreateType combinations.  Is there a way to remove these gaps and add in horizontal rules that extend left through the CreateType and Genre names?  In short, are there options to clean up the look (the general layout; I'm not concerned about the jumble of overlapping titles since my actual dataset is much smaller)?  Thanks! @dm-p  @KerKol 

{
  "data": {"name": "dataset"},
  "transform": [
    {"calculate": "1", "as": "one"},
    {
      "stack": "one",
      "groupby": [
        "Major Genre",
        "Creative Type",
        "MPAA Rating"
      ],
      "sort": [
        {
          "field": "barSort",
          "order": "descending"
        }
      ],
      "as": ["ymin", "ymax"]
    },
    {
      "calculate": "(datum.ymin + datum.ymax)/2",
      "as": "ymid"
    }
  ],
  "facet": {
    "row": {
      "field": "Major Genre",
      "title": null
    }
  },
  "spec": {
    "facet": {
      "row": {
        "field": "Creative Type",
        "title": null
      }
    },
    "spec": {
      "width": 1000,
      "layer": [
        {
          "mark": {"type": "bar"},
          "encoding": {
            "y": {
              "field": "ymin",
              "type": "quantitative",
              "axis": {"title": null}
            },
            "y2": {"field": "ymax"}
          }
        },
        {
          "mark": {"type": "text"},
          "encoding": {
            "text": {"field": "Title"},
            "y": {
              "field": "ymid",
              "type": "quantitative"
            }
          }
        },
        {
          "mark": {
            "type": "text",
            "dy": -10
          },
          "encoding": {
            "text": {
              "field": "Title",
              "type": "quantitative",
              "aggregate": "count"
            },
            "y": {
              "field": "Title",
              "type": "quantitative",
              "aggregate": "count"
            }
          }
        }
      ],
      "encoding": {
        "x": {
          "field": "MPAA Rating",
          "type": "nominal",
          "axis": {
            "title": null,
            "labelAngle": 0
          }
        }
      }
    }
  }
}

 

1 ACCEPTED SOLUTION

I don't know if this helps?

Set spacing to 5, and view fill colour to grey

KerKol_2-1666605300036.png

"spec": {
"facet": {
"row": {
"field": "Creative Type",
"title": null
}
}, "spacing" : 5,

 

 

"view": {"stroke": "black", "fill": "lightgrey"},





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
KerKol
Super User
Super User

I'm struggling to follow.

Are you able to draw what you want to achieve?

KerKol_0-1666604124692.png

KerKol_1-1666604621209.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I don't know if this helps?

Set spacing to 5, and view fill colour to grey

KerKol_2-1666605300036.png

"spec": {
"facet": {
"row": {
"field": "Creative Type",
"title": null
}
}, "spacing" : 5,

 

 

"view": {"stroke": "black", "fill": "lightgrey"},





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@KerKol thanks for the tips on spacing and view, they definitely improve the look.  I'm still getting large gaps between genres (this screenshot shows Adventure to Black Comedy), and my Deneb code still has warnings that seem to say spec should not contain facet ("spec": {"facet": ...}}).  I came up with a workaround, and with the addition of spacing and view, I'm quite happy with the look even though I'm still intrigued about the use of multiple facets.

patBear_0-1666622489232.png

 

v-jayw-msft
Community Support
Community Support

Hi @patBear ,

 

This is the relevant information I can find, I hope it helps you.

Declarative Visualization in Power BI | Deneb (deneb-viz.github.io)

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.