5 added 95 characters in body
source | link

Edit: getting rid of This is a prototype, it can not handle FilledCurveText Inset and some more complicated directives efficiently but I don't have time / motivation to speed things upimprovie it.


Here's something fun:

g = Normal @ Show @ CommunityGraphPlot[
     ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]
];

enter image description here

dist = Normalize[#] (2./Pi ArcTan[Norm[5 #]]) &;

DynamicModule[{drag,pts,prims}
 ,
 pts = Union@Cases[g, {_?NumericQ, _?NumericQ}, \[Infinity]];

 prims = (
    First[g] /. Thread[# -> Range@Length@#] &@pts)/. FilledCurve -> (# &);

 Panel@Column[{EventHandler[
     Graphics[{
          GraphicsComplex[ Dynamic[dist /@ pts], prims]
      }, 
      ImageSize -> 500, 
      PlotRange -> 1], 
  {"MouseDown" :> {drag = {MousePosition@"GraphicsScaled"}}, 
   "MouseDragged" :> {drag = {Last@drag, 
          MousePosition@"GraphicsScaled"};
        pts = (# + 5 (#2 - # & @@ drag) & /@ pts)}}]}]]

enter image description here

Edit: getting rid of FilledCurve to speed things up.


Here's something fun:

g = Normal @ Show @ CommunityGraphPlot[
     ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]
];

enter image description here

dist = Normalize[#] (2./Pi ArcTan[Norm[5 #]]) &;

DynamicModule[{drag,pts,prims}
 ,
 pts = Union@Cases[g, {_?NumericQ, _?NumericQ}, \[Infinity]];

 prims = (
    First[g] /. Thread[# -> Range@Length@#] &@pts)/. FilledCurve -> (# &);

 Panel@Column[{EventHandler[
     Graphics[{
          GraphicsComplex[ Dynamic[dist /@ pts], prims]
      }, 
      ImageSize -> 500, 
      PlotRange -> 1], 
  {"MouseDown" :> {drag = {MousePosition@"GraphicsScaled"}}, 
   "MouseDragged" :> {drag = {Last@drag, 
          MousePosition@"GraphicsScaled"};
        pts = (# + 5 (#2 - # & @@ drag) & /@ pts)}}]}]]

enter image description here

This is a prototype, it can not handle Text Inset and some more complicated directives efficiently but I don't have time / motivation to improvie it.


Here's something fun:

g = Normal @ Show @ CommunityGraphPlot[
     ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]
];

enter image description here

dist = Normalize[#] (2./Pi ArcTan[Norm[5 #]]) &;

DynamicModule[{drag,pts,prims}
 ,
 pts = Union@Cases[g, {_?NumericQ, _?NumericQ}, \[Infinity]];

 prims = (
    First[g] /. Thread[# -> Range@Length@#] &@pts)/. FilledCurve -> (# &);

 Panel@Column[{EventHandler[
     Graphics[{
          GraphicsComplex[ Dynamic[dist /@ pts], prims]
      }, 
      ImageSize -> 500, 
      PlotRange -> 1], 
  {"MouseDown" :> {drag = {MousePosition@"GraphicsScaled"}}, 
   "MouseDragged" :> {drag = {Last@drag, 
          MousePosition@"GraphicsScaled"};
        pts = (# + 5 (#2 - # & @@ drag) & /@ pts)}}]}]]

enter image description here

4 added 130 characters in body
source | link

here'sEdit: getting rid of FilledCurve to speed things up.


Here's something fun:

g = Normal @ Show @ CommunityGraphPlot[
     ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]
];

enter image description here

dist = Normalize[#] (2./Pi ArcTan[Norm[5 #]]) &;

DynamicModule[{drag,pts,prims}
 ,
 pts = Union@Cases[g, {_?NumericQ, _?NumericQ}, \[Infinity]];

 prims = (
    First[g] /. Thread[# -> Range@Length@#] &@pts;&@pts)/. FilledCurve -> (# &);

 Panel@Column[{EventHandler[
     Graphics[{Dynamic@GraphicsComplex[dist
          GraphicsComplex[ Dynamic[dist /@ ptspts], prims]
      }, 
      ImageSize -> 500, 
      PlotRange -> 
       1], 
  {"MouseDown" :> {drag = {MousePosition@"GraphicsScaled"}}, 
   "MouseDragged" :> {drag = {Last@drag, 
          MousePosition@"GraphicsScaled"};
        pts = (# + 5 (#2 - # & @@ drag) & /@ pts)}}]}]]

enter image description here

here's something fun:

g = Normal @ Show @ CommunityGraphPlot[
     ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]
];

enter image description here

dist = Normalize[#] (2./Pi ArcTan[Norm[5 #]]) &;

DynamicModule[{drag,pts,prims}
 ,
 pts = Union@Cases[g, {_?NumericQ, _?NumericQ}, \[Infinity]];

 prims = First[g] /. Thread[# -> Range@Length@#] &@pts;

 Panel@Column[{EventHandler[
     Graphics[{Dynamic@GraphicsComplex[dist /@ pts, prims]}, 
      ImageSize -> 500, 
      PlotRange -> 
       1], 
  {"MouseDown" :> {drag = {MousePosition@"GraphicsScaled"}}, 
   "MouseDragged" :> {drag = {Last@drag, 
          MousePosition@"GraphicsScaled"};
        pts = (# + 5 (#2 - # & @@ drag) & /@ pts)}}]}]]

enter image description here

Edit: getting rid of FilledCurve to speed things up.


Here's something fun:

g = Normal @ Show @ CommunityGraphPlot[
     ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]
];

enter image description here

dist = Normalize[#] (2./Pi ArcTan[Norm[5 #]]) &;

DynamicModule[{drag,pts,prims}
 ,
 pts = Union@Cases[g, {_?NumericQ, _?NumericQ}, \[Infinity]];

 prims = (
    First[g] /. Thread[# -> Range@Length@#] &@pts)/. FilledCurve -> (# &);

 Panel@Column[{EventHandler[
     Graphics[{
          GraphicsComplex[ Dynamic[dist /@ pts], prims]
      }, 
      ImageSize -> 500, 
      PlotRange -> 1], 
  {"MouseDown" :> {drag = {MousePosition@"GraphicsScaled"}}, 
   "MouseDragged" :> {drag = {Last@drag, 
          MousePosition@"GraphicsScaled"};
        pts = (# + 5 (#2 - # & @@ drag) & /@ pts)}}]}]]

enter image description here

3 added 92 characters in body
source | link

here's something fun:

g = Normal @ Show @ CommunityGraphPlot[
     ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]
];

enter image description here

dist = Normalize[#] ( 2./Pi ArcTan[Norm[5 #]]) &;

g = CompleteGraph[{#, #, #, #} &@4];

DynamicModule[{
  drag, pts, prims
  }
 ,
 {pts, prims} = List @@ First@Show@g;

Union@Cases[g, Panel@Column[{

  _?NumericQ, _?NumericQ}, EventHandler[\[Infinity]];

    prims Graphics[
= First[g] /. Thread[# -> Range@Length@#] GraphicsComplex[&@pts;
  
 Panel@Column[{EventHandler[
     Dynamic[distGraphics[{Dynamic@GraphicsComplex[dist /@ pts]pts,
  prims]},  
     prims]
 ImageSize -> 500,  
  , ImageSize -> 900, PlotRange -> 1
      ],
  1],  
  {"MouseDown" :> {

        drag = {MousePosition@"GraphicsScaled"}},
    
   "MouseDragged" :> {
 drag = {Last@drag,  
     drag = {Last@drag,   MousePosition@"GraphicsScaled"};
        pts = (# + 5 (#2 - # & @@ drag) & /@ pts)}

      }
     ]
    }]
 ]]]

enter image description hereenter image description here

here's something fun:

dist = Normalize[#] ( 2./Pi ArcTan[Norm[5 #]]) &;

g = CompleteGraph[{#, #, #, #} &@4];

DynamicModule[{
  drag, pts, prims
  }
 ,
 {pts, prims} = List @@ First@Show@g;

 Panel@Column[{

    EventHandler[

     Graphics[
      GraphicsComplex[
       Dynamic[dist /@ pts],
        prims]
      , ImageSize -> 900, PlotRange -> 1
      ],
     {"MouseDown" :> {

        drag = {MousePosition@"GraphicsScaled"}},
      "MouseDragged" :> {
         drag = {Last@drag, MousePosition@"GraphicsScaled"};
        pts = (# + 5 (#2 - # & @@ drag) & /@ pts)}

      }
     ]
    }]
 ]

enter image description here

here's something fun:

g = Normal @ Show @ CommunityGraphPlot[
     ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]
];

enter image description here

dist = Normalize[#] (2./Pi ArcTan[Norm[5 #]]) &;

DynamicModule[{drag,pts,prims}
 ,
 pts = Union@Cases[g, {_?NumericQ, _?NumericQ}, \[Infinity]];

 prims = First[g] /. Thread[# -> Range@Length@#] &@pts;
 
 Panel@Column[{EventHandler[
     Graphics[{Dynamic@GraphicsComplex[dist /@ pts, prims]},  
      ImageSize -> 500,  
      PlotRange -> 
       1],  
  {"MouseDown" :> {drag = {MousePosition@"GraphicsScaled"}},  
   "MouseDragged" :> {drag = {Last@drag,  
          MousePosition@"GraphicsScaled"};
        pts = (# + 5 (#2 - # & @@ drag) & /@ pts)}}]}]]

enter image description here

2 added 88 characters in body
source | link
1
source | link