forked from devsecopsmaturitymodel/DevSecOps-MaturityModel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscutter.php
More file actions
81 lines (72 loc) · 1.75 KB
/
scutter.php
File metadata and controls
81 lines (72 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
/**
* scutter.php
*
* @package default
*/
include_once "head.php";
?>
<body>
<?php
include_once "navi.php";
?>
<script src="assets/js/scutter.js"></script>
<?php
include_once "data.php";
include_once "functions.php";
$aggregated = ($_GET['aggregated'] ?? false) == "true" ? "true" : false;
/**
*
* @param unknown $dimensions
* @return unknown
*/
function getJson($dimensions) {
$json = array();
$shapes = array('circle', 'cross', 'triangle-up', 'triangle-down', 'diamond', 'square');
$shape = 0;
foreach (getActions($dimensions) as list($dimension, $subdimension, $element)) {
$values = array();
foreach ($element as $activityName => $content) {
$values[] = array(
"series" => 0,
"shape" => $shapes[$shape] ?? "square",
"size" => 3000,
"x" => 5-getDifficultyOfImplementation($dimensions, $content),
"y" => $content["usefulness"],
"key" => $activityName
);
}
$json[] = array(
"key" => "$dimension - " . $subdimension,
"values" => $values
);
$shape++;
}
return json_encode($json);
}
?>
<script>
/**************************************
* Simple test data generator
*/
function getData() { //# groups,# points per group
var data = [],
shapes = ['circle', 'cross', 'triangle-up', 'triangle-down', 'diamond', 'square'],
data = <?php echo getJson($dimensions); ?>;
return data;
}
</script>
<button id="toggleChartLabel">Toggle Label</button>
<form action="?" method="get">
<?php
$aggregated = $_GET['aggregated'] ?? null;
?>
<button id="">
<?php
echo ($aggregated == "true") ? "Show specific values" : "Show total values";
?>
</button>
</form>
<div id='chart'>
<svg style='height:500px'></svg>
</div>