netcreateorg / netcreate-2018

Please report bugs, problems, ideas in the project Issues page: https://github.com/netcreateorg/netcreate-2018/issues
Other
11 stars 2 forks source link

Hotifix: Set Markdown Image Width #220

Closed benloh closed 2 years ago

benloh commented 2 years ago

Merge after #217!!!

This addresses #214.

Add css to set the max width of any images under .nodeEntry to 100%. This should make them fit within the editor boundary. Any node field or edit field should be a child class of .nodeEntry.

benloh commented 2 years ago

@jdanish Please verify that this correctly sets the image width.

jdanish commented 2 years ago

Works great in the node inspector, but not resizing in the node table yet.

benloh commented 2 years ago

Ah, of course. Should be fixed now with d23e089fe7612c20837ecbebe818027110ba6404.

jdanish commented 2 years ago

Looks good! Merge away!!

jdanish commented 2 years ago

One other thing I noticed is that in this hotfix, the nodes pull together and pack densely when compared to dev (dev seems correct to me). Assuming this is something that was subsequently fixed in dev, no big deal, but I figured I'd call it out just in case. Here are two screen captures of the same network in this branch and dev to illustrate. @benloh

Screen Shot 2022-03-14 at 8 33 40 AM Screen Shot 2022-03-14 at 8 33 55 AM
benloh commented 2 years ago

Ah, his was my attempt to make H213 a little more compact while I was documenting and fixing the way the simulation forces worked to better account for node sizes and collisions. You can tweak this value in d3-simplenetgraph.js line 104. The original value was 130, which in our updated forces formula felt too spacious for me. I set it to 25 now, which is definitely cozy but I felt like it clumped things better.

I recommend that you try tweaking the value and then open it with a number of different graphs (small, large, unconnected), and then let me know the value you prefer (or you can hotfix it).

jdanish commented 2 years ago

Cool. Deferring to @kalanicraig but wanted to ask a question that might help: is it possible / easy to either a) calculate dynamically based on the size of the graph (maybe a bigger number for smaller graphs?) or b) put it in the template?

benloh commented 2 years ago

I think what you really want is a slider that you can use to dynamically adjust the link length. But'll have to wait for the next round of funding.

Adjusting based on the size of the graph might not quite work -- I think it'd be heavily dependent on how the nodes were linked up.

In my tweaking I was attempting to make sure that giant nodes were not "eating" up their satellites. In the previous version with H213 there were some nodes that were appearing inside of "Theodora" for instance. But that has more to do with tweaking collision and charge rather than link length.

Putting it in the template ought to work. In fact that might be something we would combine with the slider so that your value is saved across sessions. OTOH, we might want it to also be an temporary value so that you can tweak as you explore.

In any case I think this is something we address next round.

jdanish commented 2 years ago

This all makes sense, and it sounds like next round it is. In my tinkering, I suggest the following but defer to Kalani: