Transforming the color of a globe from black to white with gio js

After searching for a solution to change the color of a Three.js globe, I came across a link that didn't work as expected: Change the color of a Three.js globe. My goal is to change the globe color from black to white using .

I attempted to use the following code to change the color, but I didn't achieve the desired outcome:

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();

Answer №1

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

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

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

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

    graphDiagram.model = new go.GraphLinksModel(
    [
      { key: 1, text: "One" },
      { key: 2, text: "Two" },
      { key: 3, text: "Three" }
    ],
    [
      { from: 1, to: 2 },
      { from: 1, to: 3 }
    ]);
  }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Exploring the power of AJAX and JSON in a jQuery calendar within an ASP.NET environment

Currently, I am utilizing a jQuery calendar that employs Ajax with JSON to populate its events. My goal is to retrieve the JSON array from a C# function in ASP.net. However, despite my efforts, I haven't been successful in populating the calendar corr ...

if the statement encounters an error while execution, then

I am struggling to run a for loop on JSON data in order to plot new lines on a Canvas chart based on the test names and their values. Unfortunately, I can't seem to display different horizontal lines on the chart. $(document).ready(function(){ ...

Send an array from PHP to jQuery using AJAX, then send the array back from jQuery to PHP

I am facing a dilemma where I am passing an array from PHP to jQuery AJAX using `json_encode` and storing it in an empty array declared in the jQuery script as `var myarr = []`. Later in the same script, I am sending the same array `myarr` back to the PHP ...

Error: 'window not defined' or 'document not defined' encountered while importing a module in Next.js

I'm working on integrating a Wysiwyg editor into my web application. However, I encountered an error when trying to import the editor module. I tried using both react-draft-wysiwyg and react-quill. The former resulted in a "window not defined" error, ...

Could this method of utilizing GET be considered incorrect?

I've been tackling a project and encountered an issue that I was only able to resolve by using the following code snippet: header("Location:messages.php?ID_Conversation=$row[ID]"); Do you think this approach is incorrect? ...

Showing the total quantity of products, reminiscent of a virtual shopping basket

I am trying to show a number similar to how a shopping cart displays items. The php code I was given currently shows a cookie value, which is mostly functional. However, if you encounter errors while adding items to the cart, it increases the cookie count ...

Is it possible to initially design a login page using HTML/CSS and JavaScript, and then integrate VUE into it?

As part of a school project, I am tasked with developing a web-based application for a library system. The goal is to create a platform where librarians can login and manage books by adding, removing, or editing them. My responsibility lies in handling the ...

Is there a way to arrange the cards in a row so they fill up the grid before moving on to the next row?

After retrieving data from a table in my database, I am displaying it on the screen as cards. However, the issue is that all the cards are displaying on the left side of the screen in a single column, rather than appearing in rows of 3 as desired. Below i ...

Send a distinct input value from a textbox to PHP

I have a dynamic search feature on my website that populates an HTML textbox with search results using AJAX. It's working well so far. However, I want to take it a step further by displaying the text of the article in the textbox while passing the art ...

"Implement a smooth transition effect lasting 1000 milliseconds when a class is added via

I'm attempting to use the fadeIn 1000 effect when a class is added through a Click function. I have already attempted this: http://jsfiddle.net/rf7mudL5/ HTML <span class="date-outer">Text will Red on fadeIn</span> <button class="mo ...

TypeScript code runs smoothly on local environment, however encounters issues when deployed to production

<div> <div style="text-align:center"> <button class="btnClass">{{ submitButtonCaption }}</button> <button type="button" style="margin-left:15px;" class="cancelButton" (click)="clearSearch()"> {{ clearButtonCapt ...

The fullscreen API allows for the creation of a full-screen element containing internal elements, while also enabling the functionality

Is it possible to utilize the fullscreen API to make any element fullscreen, even if it contains multiple internal elements, while still maintaining the functionality of dropdowns and other custom elements that may be located in different areas of the page ...

iOS Development with Webkit Desktop Browser

As I delve into jQuery and jQtouch for building web-based applications for iOS, testing on my device has been quite tedious. I am looking for a lightweight and portable browser to test my applications on desktop. Any recommendations would be greatly appr ...

Using discord.js does not allow line breaks in embed descriptions

const chatRoom = replyOptions.getRoom("room"); const header = replyOptions.getHeader("header"); const content = replyOptions.getContent("text"); const chatEmbed = new MessageEmbed() .setColor('DARK_VIVID_PURPLE') ...

I am only able to trigger my AJAX request once

Whenever I click on a checkbox, an ajax function is triggered. This function sends a query string to a PHP script and returns relevant HTML. Strangely enough, if I first select a dropdown option and then check another checkbox along with the previous one ...

String variable representing the name of a React element

As I was reviewing the source code of a React UI library, I stumbled upon an interesting code pattern that I will simplify here: function Test() { let Button = "button"; // ... return <Button>Click me</Button>; } I'm curious about ...

Problem with spacing in Bootstrap horizontal layouts

My project is currently empty except for a code snippet I copied from Bootstrap's horizontal gutters page. Unfortunately, I am not seeing any horizontal gaps as expected. Why could this be? It seems that only vertical gutters are working... Click her ...

Liquid backdrop centered immobile elements

I'm facing some challenges trying to figure out the most efficient and correct way to achieve this layout, similar to Stack Overflow's design. I want a header with a background color that spans the entire width of the page, while keeping the cont ...

Loss of image quality when utilizing Next/Image in NEXT JS

I am currently developing a web application using Next.js 13, and I recently noticed a decrease in the quality of my images. I'm not sure what went wrong or what I may have missed. Upon inspecting the HTML element on the browser, I found this code: & ...

Is it possible to utilize Ajax submit requests within a (function($){...}(jQuery)); block?

As a PHP developer with some knowledge of JavaScript, I am currently using AJAX to send requests to the server. I recently came across the practice of enclosing all code within an anonymous JavaScript function like: (function($){ //code here }(jQuery)). Fo ...