Refactored LCPDataGrid

This commit is contained in:
Jeremy Rangel
2025-01-24 03:06:04 -08:00
parent 23944b0052
commit be3a4fb9ff
12 changed files with 427 additions and 689 deletions

View File

@ -13,14 +13,7 @@
"attributes": {
"columnTypes": {
"type": "object",
"default": {
"ID": "lcpText",
"Label": "lcpText",
"Value": "lcpNumber",
"Color": "lcpColor",
"Content": "lcpText",
"Parent": "lcpText"
}
"default": {}
},
"enableStackedBars": {
"type": "boolean",
@ -67,6 +60,14 @@
}
]
},
"enableGroupedBars": {
"type": "boolean",
"default": false
},
"groupedBarsColumn": {
"type": "string",
"default": ""
},
"chartHeight": {
"type": "string",
"default": "400px"
@ -206,6 +207,14 @@
"yGridColor": {
"type": "string",
"default": "#e0e0e0"
},
"includeDataChart": {
"type": "boolean",
"default": false
},
"allowChartDataDownload": {
"type": "boolean",
"default": false
}
},
"textdomain": "lcp-visualize",

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '97d348e4919de980ad6b');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'a5fc7ad18ecfe8ed81b6');

File diff suppressed because one or more lines are too long

View File

@ -14,12 +14,7 @@
"columnTypes": {
"type": "object",
"default": {
"ID": "lcpText",
"Label": "lcpText",
"Value": "lcpNumber",
"Color": "lcpColor",
"Content": "lcpText",
"Parent": "lcpText"
}
},
"enableStackedBars": {
@ -53,6 +48,14 @@
{ "ID": "lcpDatapoint-2", "Label": "Sample 2", "Value": 50, "Color": "#ff0000", "Content": "<p>Second item</p>", "Parent": "lcpDatapoint-1" }
]
},
"enableGroupedBars": {
"type": "boolean",
"default": false
},
"groupedBarsColumn": {
"type": "string",
"default": ""
},
"chartHeight": {
"type": "string",
"default": "400px"
@ -192,6 +195,14 @@
"yGridColor" :{
"type": "string",
"default": "#e0e0e0"
},
"includeDataChart" :{
"type": "boolean",
"default": false
},
"allowChartDataDownload" :{
"type": "boolean",
"default": false
}
},
"textdomain": "lcp-visualize",

View File

@ -18,34 +18,13 @@ export default function Edit({ attributes, setAttributes }) {
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Categokhkjhkjhkjhky 2", color: "#00ff00" },
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Category 1", color: "#ff0000" },
{ Label: "Category 2", color: "#00ff00" },
{ Label: "Category 3", color: "#0000ff" }
{ Label: "Cat 2", color: "#00ff00" },
{ Label: "Coy 1", color: "#ff0000" },
];
const {
@ -64,7 +43,9 @@ export default function Edit({ attributes, setAttributes }) {
hierarchicalSource = 'parent',
hierarchicalColumnOrder = '',
renderLegend = false,
toolbarLocation = 'top'
toolbarLocation = 'top',
enableGroupedBars = false,
groupedBarsColumn = ''
} = attributes;
const blockProps = useBlockProps();