gojs实现多轮多场比赛可编辑打分图表效果代码

代码语言:html

所属分类:图表

代码描述:gojs实现多轮多场比赛可编辑打分图表效果代码

代码标签: gojs 多轮 多场 比赛 可编辑 打分 图表

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
</head>

<body>
    <script src="//repo.bfw.wiki/bfwrepo/js/go.js"></script>

    <div id="allSampleContent" class="p-4 w-full">
        <script id="code">
            function init() {
        
              // Since 2.2 you can also author concise templates with method chaining instead of GraphObject.make
              // For details, see https://gojs.net/latest/intro/buildingObjects.html
              const $ = go.GraphObject.make;  // for conciseness in defining templates
        
              myDiagram =
                $(go.Diagram, "myDiagramDiv",  // create a Diagram for the DIV HTML element
                  {
                    "textEditingTool.starting": go.TextEditingTool.SingleClick,
                    "textEditingTool.textValidation": isValidScore,
                    layout: $(go.TreeLayout, { angle: 180 }),
                    "undoManager.isEnabled": true
                  });
        
              // validation function for editing text
              function isValidScore(textblock, oldstr, newstr) {
                if (newstr === "") return true;
                var num = parseInt(newstr, 10);
                return !isNaN(num) && num >= 0 && num < 1000;
              }
        
              // define a simple Node template
              myDiagram.nodeTemplate =
                $(go.Node, "Auto",
                  { selectable: false },
                  $(go.Shape, "Rectangle",
                    { fill: '#8C8C8C', stroke: null },
     .........完整代码请登录后点击上方下载按钮下载查看

网友评论0