1

I find some some link for the change of the color but it didn't work: Change the color of a Three.js globe i need to change the color of the globe from black to white by using http://gio.js

I tried following code to change color but unable to produce expected results:

var container = document.getElementById("globalArea");
    var configs = {
        "control": {
            "stats": false,
            "disableUnmentioned": false,
            "lightenMentioned": true,
            "inOnly": false,
            "outOnly": false,
            "initCountry": "PK,CN",
            "halo": true,
            "transparentBackground": true,
            "autoRotation": false,
            "rotationRatio": 0

        },
        "color": {
            "surface": 10334380,
            "selected": 14853451,
            "in": 11247212,
            "out": 14823329,
            "halo": 9539985,
        },
        "brightness": {
            "ocean": 0,
            "mentioned": 0,
            "related": 0
        }

    };
    var controller = new GIO.Controller(container, configs);

    console.log(controller);
    //controller.setHaloColor("#7E8084");
    controller.removeHalo();
    controller.setTransparentBackground(true);
    controller.setInitCountry("BE");
    controller.lightenMentioned(true);
    controller.adjustOceanBrightness(0.8);
    controller.setSurfaceColor("#FFFFFF");
    controller.adjustRelatedBrightness(0.8);
    controller.adjustMentionedBrightness(0.8);
    //controller.addData(data);
    controller.init();
DohaHelmy
  • 770
  • 1
  • 7
  • 19

1 Answers1

0
 function init() {
    var $ = go.GraphObject.make;

    myDiagram =
      $(go.Diagram, "myDiagramDiv",
          {
            initialContentAlignment: go.Spot.Center  // for v1.*
          });

    myDiagram.nodeTemplate =
      $(go.Node, "Auto",
        $(go.Shape,
          { fill: "darkslategray", portId: "" },
          new go.Binding("fill", "isHighlighted", function(h) { return h ? "red" : "darkslategray"; }).ofObject()),
        $(go.TextBlock,
          { margin: 8, stroke: "white" },
          new go.Binding("text"))
      );

    myDiagram.linkTemplate =
      $(go.Link,
        {
          click: function(e, link) {
            e.diagram.commit(function(diag) {
              diag.clearHighlighteds();
              link.toNode.isHighlighted = true;
            }, "highlight toNode")
          }
        },
        $(go.Shape),
        $(go.Shape, { toArrow: "OpenTriangle" })
      );

    myDiagram.model = new go.GraphLinksModel(
    [
      { key: 1, text: "Alpha" },
      { key: 2, text: "Beta" },
      { key: 3, text: "Gamma" }
    ],
    [
      { from: 1, to: 2 },
      { from: 1, to: 3 }
    ]);
  }