sliceUrl

sliceUrl(slice: ordinal) 🡒 text, pure function

This function returns a URL that pinpoints a single slice within the dashboard. This URL can be used to offer a navigation UX that differs from the default slice selector.

table T[t] = with 
  [| "Pant" as Product, "Blue" as Color |]
  [| "Cap",             "Red"           |]
  [| "T-shirt",         "White"         |]

T.slice = sliceDashboard(T.Product) by t

show table "One slice at a time" a1b2 slices: slice with
    T.Product
    T.Color

show table "Click to select a slice" a3b5 with
    T.Product { href: #[sliceUrl(T.slice)] }

sliceUrl(slice: ordinal, tab: text) 🡒 text, pure function

table T[t] = with 
  [| "Pant" as Product, "Blue" as Color |]
  [| "Cap",             "Red"           |]
  [| "T-shirt",         "White"         |]

T.slice = sliceDashboard(T.Product) by t

show table "One slice at a time (no color)" a1b2 slices: slice { tileTab: "noColor" } with
    T.Product
show table "One slice at a time (with color)" a1b2 slices: slice { tileTab: "Color" } with
    T.Product
    T.Color

show table "Click to select a slice" a3b5 with
    "\{T.Product} (no color)"  { href: #[sliceUrl(T.slice, "noColor")] }
    "\{T.Product} (with color)" { href: #[sliceUrl(T.slice, "Color")] }
User Contributed Notes
0 notes + add a note