mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-02 23:05:23 +00:00
fix: update
This commit is contained in:
parent
9a0fe83e95
commit
17b4e9c053
@ -22,7 +22,15 @@ limitations under the License. -->
|
|||||||
>
|
>
|
||||||
<svg :width="width - 100" :height="height" style="background-color: #fff">
|
<svg :width="width - 100" :height="height" style="background-color: #fff">
|
||||||
<g v-for="(n, index) in topologyLayout.nodes" :key="index">
|
<g v-for="(n, index) in topologyLayout.nodes" :key="index">
|
||||||
<circle class="node" r="18" stroke-width="6" stroke="#72c59f" fill="#fff" :cx="n.x" :cy="n.y" />
|
<circle
|
||||||
|
class="node"
|
||||||
|
r="18"
|
||||||
|
stroke-width="6"
|
||||||
|
:stroke="n.isReal ? '#72c59f' : 'red'"
|
||||||
|
fill="#fff"
|
||||||
|
:cx="n.x"
|
||||||
|
:cy="n.y"
|
||||||
|
/>
|
||||||
<text :x="n.x - (n.name.length * 6) / 2" :y="n.y + n.height + 12" style="pointer-events: none">
|
<text :x="n.x - (n.name.length * 6) / 2" :y="n.y + n.height + 12" style="pointer-events: none">
|
||||||
{{ n.name.length > 20 ? `${n.name.substring(0, 20)}...` : n.name }}
|
{{ n.name.length > 20 ? `${n.name.substring(0, 20)}...` : n.name }}
|
||||||
</text>
|
</text>
|
||||||
@ -195,8 +203,7 @@ limitations under the License. -->
|
|||||||
levels.push(a);
|
levels.push(a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const options = {};
|
topologyLayout.value = layout(levels);
|
||||||
topologyLayout.value = layout(levels, options);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import * as d3 from "d3";
|
import * as d3 from "d3";
|
||||||
export function layout(levels: any, options: any = {}) {
|
export function layout(levels: any) {
|
||||||
// precompute level depth
|
// precompute level depth
|
||||||
levels.forEach((l: any, i: any) => l.forEach((n: any) => (n.level = i)));
|
levels.forEach((l: any, i: any) => l.forEach((n: any) => (n.level = i)));
|
||||||
|
|
||||||
@ -30,10 +30,6 @@ export function layout(levels: any, options: any = {}) {
|
|||||||
const bundle_width = 14;
|
const bundle_width = 14;
|
||||||
const metro_d = 4;
|
const metro_d = 4;
|
||||||
|
|
||||||
options.c ||= 16;
|
|
||||||
const c = options.c;
|
|
||||||
options.bigc ||= node_width + c;
|
|
||||||
|
|
||||||
nodes.forEach((n: any) => (n.height = 5 * metro_d));
|
nodes.forEach((n: any) => (n.height = 5 * metro_d));
|
||||||
|
|
||||||
let x_offset = padding;
|
let x_offset = padding;
|
||||||
|
Loading…
Reference in New Issue
Block a user