Visual Console Refactor: fixed the donut graph
Former-commit-id: a59da7d787571779c3dbc1be790855fda83d4b00
This commit is contained in:
parent
3c2e65a8a5
commit
1cb15c9404
|
@ -153,8 +153,18 @@ final class DonutGraph extends Item
|
|||
if ($isString === true) {
|
||||
$graphData = \get_donut_module_data($moduleId);
|
||||
|
||||
$width = (int) $data['width'] > 0 ? (int) $data['width'] : 500;
|
||||
$height = (int) $data['height'] > 0 ? (int) $data['height'] : 500;
|
||||
$width = (int) $data['width'];
|
||||
$height = (int) $data['height'];
|
||||
|
||||
// Default width.
|
||||
if ($width <= 0) {
|
||||
$width = 300;
|
||||
}
|
||||
|
||||
// Default height.
|
||||
if ($height <= 0) {
|
||||
$height = 300;
|
||||
}
|
||||
|
||||
$data['html'] = \d3_donut_graph(
|
||||
(int) $data['id'],
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -46,18 +46,6 @@ export function donutGraphPropsDecoder(
|
|||
}
|
||||
|
||||
export default class DonutGraph extends Item<DonutGraphProps> {
|
||||
/**
|
||||
* @override Item.resizeElement
|
||||
* Resize the DOM content container.
|
||||
* @param width
|
||||
* @param height
|
||||
*/
|
||||
protected resizeElement(width: number, height: number): void {
|
||||
if (width <= 0) width = 200;
|
||||
if (height <= 0) height = 200;
|
||||
super.resizeElement(width, height);
|
||||
}
|
||||
|
||||
protected createDomElement(): HTMLElement {
|
||||
const element = document.createElement("div");
|
||||
element.className = "donut-graph";
|
||||
|
|
Loading…
Reference in New Issue