cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1610
Views
0
Helpful
4
Replies

how the USProjection function works

sshrabah43
Beginner
Beginner

Hi all,

I've  defined FRMapLayout a new layout, which has the SVG of the map of France and it works (i.e., correctly displayed). However, when I set the coordinates of  my nodes (each node correspond to a city for example Paris) they are not positioned correctly. After digging a little bit I found that the positioning is done by the USProjection function wich convert the latitude & longitude coordinates  to X & Y coordinates on the SVG. Unfortunately, I couldn't understand in order to rewrite an FRProjection function.

Can someone explain the principals

Thx in advanced.

4 Replies 4

alzverev
Cisco Employee
Cisco Employee

Hi Guedrez,

Is that possible to share the code that you did, so that we could help you?

Thanks

Hi Aleksei,

I have a similar problem. I am trying to create new topology layout but unable to understand how the USProjection works or correctly set node's position.

Here's my code :

http://codepen.io/deniza/pen/bqVVvJ

I just rename the USMap Topology related variables and fuınctions.

Hi,

I managed to change projection. It seems USProjection use Albert's USA Projection.  I used d3 geo projection library for using Turkey Layout. I used mercator projection method which seems fine.

    var NXprojection = d3.geoMercator().scale(2800).center([35.25,38.8]);

I just embedded this into next.js, is there any method to register new layout without changing the original code?

from the discussion  D3 Geomap Integration?

created separate file and registered it,

    topo.registerLayout('TURKEYMap', new nx.graphic.Topology.TURKEYMapLayout())

http://codepen.io/deniza/pen/bqVVvJ?editors=0010

Projection method should be changed or adjusted.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers