Skip to content

Instantly share code, notes, and snippets.

View PBI-DataVizzle's full-sized avatar
💭
Shizzle my Vizzle 🤓

Imran Haq PBI-DataVizzle

💭
Shizzle my Vizzle 🤓
View GitHub Profile
@PBI-DataVizzle
PBI-DataVizzle / highlight_line_on_hover.json
Created September 21, 2024 16:54
highlight_line_on_hover
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"config": {
"range": {
"category": [
"#000000ff",
"#374c80",
"#ff764a",
"#bc5090",
"#ffa600",
let
Switch = Function.From(
type function (value as any, l as list, default as any) as any,
(params) =>
let
// Function to select nth item of list
// If you pass in zero, you get even indices
// If you pass in one, you get odd indices
fnSelectEvenOdd = (lst as list, remainder as number) as list =>
let
let
pqmath.Benford =
let
Benford = Function.From(
type function (num as number) as record,
(params) =>
let
len = Text.Length(Text.From(params{0})),
first = if len >= 1 then Number.From(Text.ToList(Text.From(params{0})){0}) else null,
second = if len >= 2 then Number.From(Text.ToList(Text.From(params{0})){1}) else null,
@PBI-DataVizzle
PBI-DataVizzle / sunburst_radial_stacked_vega_v2.json
Created September 1, 2024 17:35
sunburst_radial_stacked_vega_v2
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 500,
"height": 200,
"padding": 5,
"signals": [
{
"name": "startAngle",
"value": -1.57,
"bind": {"input": "range", "min": -3.14, "max": 3.14, "step": 0.01}
@PBI-DataVizzle
PBI-DataVizzle / stacked_radial_vega_v1.json
Created September 1, 2024 17:33
stacked_radial_vega_v1
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 500,
"height": 200,
"padding": 5,
"signals": [
{
"name": "startAngle",
"value": -2.5,
"bind": {"input": "range", "min": -2.5, "max": 6.29, "step": 0.01}
@PBI-DataVizzle
PBI-DataVizzle / stacked_radial_vega_v1.json
Created September 1, 2024 17:33
stacked_radial_vega_v1
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"width": 500,
"height": 200,
"padding": 5,
"signals": [
{
"name": "startAngle",
"value": -2.5,
"bind": {"input": "range", "min": -2.5, "max": 6.29, "step": 0.01}
@PBI-DataVizzle
PBI-DataVizzle / radial_stacked_v1.json
Created September 1, 2024 17:21
radial_stacked_v1
{
"width": 400,
"height": 400,
"data": [
{
"name": "table",
"values": [
{"g": 1, "c": 0, "r": 90},
{"g": 1, "c": 1, "r": 20},
{"g": 1, "c": 2, "r": 10},
@PBI-DataVizzle
PBI-DataVizzle / radial_multiple_arc_v1.json
Created September 1, 2024 16:25
radial_multiple_arc_v1
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "A radial bar chart with multiple arcs, one for each category as a percentage of the whole.",
"params": [
{
"name": "baseRadius",
"value": 50,
"bind": {"input": "range", "min": 0, "max": 100, "step": 1}
},
{
@PBI-DataVizzle
PBI-DataVizzle / donut_exmaple_vl_v2.json
Created September 1, 2024 16:22
donut_exmaple_vl_v2
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "A half-donut chart with adjustable parameters and custom data.",
"params": [
{
"name": "radius",
"value": 0,
"bind": {"input": "range", "min": 0, "max": 100, "step": 1}
},
{
@PBI-DataVizzle
PBI-DataVizzle / radial_gist_vl.json
Created September 1, 2024 16:10
radial_gist_vl
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"description": "A simple pie chart with embedded data.",
"params": [
{
"name": "radius",
"value": 0,
"bind": {"input": "range", "min": 0, "max": 100, "step": 1}
},
{