Skip to content

[WIP] Converted topology graph to an angular component #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

skateman
Copy link
Member

@skateman skateman commented Jun 6, 2017

  • Use <canvas> for rendering instead of <svg>
  • Angularize tooltips and the context menu
  • Declaring the input as an HTML attribute
  • Declaring the filters as angular components
  • Semantic zooming with optional minimap
  • Determine fonticon font/char from CSS classes
  • Automatically centerized icons/images

@@ -46,7 +46,7 @@
"copy-webpack-plugin": "4.0.1",
"coveralls": "^2.11.15",
"css-loader": "^0.26.0",
"d3": "^4.4.1",
"d3": "^4.9.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this d3 version 4.x cause issues with patternfly c3 use of d3 version 3.x. Can they coexist without issue?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should not be a problem as this is packed as a component, but @himdel can tell you more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK the d3 object is in global namespace.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we are already using ui-components with manageiq and for now there were no issues ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ui-classic forces d3 to be ~3.5.0 (3.5.5 right now) anyway ;)

Does this PR actually depend on d3 4+?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So.. current dependency constraints:

  • kubernetes-topology-graph needs >=3.5.0, <=3.5.5 - but I assume we will drop kubernetes-topology-graph with the new topology component, right?
  • patternfly-sass needs ~3.5.17 - so we'll need to update patternfly to a version compatible with d3 4
  • patternfly-sass needs c3 ~0.4.11, which depends on d3 ~3.5.0 - so, we'll need to update patternfly to a version compatible with new enough c3 - but even the newest has that dependnecy, so either the dependency is obsolete or we can't move to d3 4 yet

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c3js/c3#1648 is the c3 issue on d3 4 compatibility - short answer - waiting for c3 1.0.0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v4 was a complete change in architecture from v3 so they are quite different even from a API standpoint.

Copy link
Contributor

@himdel himdel Jun 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, we pretty much have to put this in a separate bundle, ok.

Which means we'll need a webpack config change here to not include topology in the dist bundle, and make a separate topology-only bundle...

.. and if we're doing that, maybe it's time to separate each component into its own bundle (dialog-editor, gtl, site-switcher, toolbar and topology, I guess), abandon the everything-bundle and include just the right ones in miq. (Then you'll need to put d3-4 and topology in a separate webpacker pack on the ui-side, and that's it.)

Cc @karelhala ^

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OR i can take a look for a v3-compatible solution 😉

@mtho11
Copy link
Contributor

mtho11 commented Jun 12, 2017

I'm curious about the motivation to use canvas over svg?

@skateman
Copy link
Member Author

@mtho11 mostly because of the performance gained by not touching the DOM. Based on these measurements it should be better up to 4K. Also it won't kill the browser's debugger if you open it at the elements panel during an animation.

I'm thinking about having both SVG and canvas versions, but the semantic zooming would be much more complicated to implement in SVG.

@mtho11
Copy link
Contributor

mtho11 commented Jun 13, 2017

Ah ok, thanks for the reply @skateman!

margin-left: 0;
margin-right: 0; }

.miq-small-tile .card-view-pf {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are the card related stuff relevant for topology?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not, this is a generated file which changed from single-line to multiline.

(@skateman you may want to run webpack -p to recompile these..)

- Use <canvas> for rendering instead of <svg>
- Angularize tooltips and the context menu
- Declaring the input as an HTML attribute
- Declaring the filters as angular components
- Semantic zooming with optional minimap
- Determine fonticon font/char from CSS classes
- Automatically centerized icons/images
@abonas
Copy link
Member

abonas commented Jun 14, 2017

is this replacing the original kubernetes-topology-graph component?
originally that component was in use in miq, openshift and cockpit, so if this is a replacement, it means that the topology will be completely separate in those projects (potentially - ux wise, bugs fixing, etc)
I'm not objecting, just raising awareness :)

@skateman
Copy link
Member Author

@abonas we'll have a meeting about this on Monday where the direction will be converge to merging all the good stuff into a single implementation 😉

@martinpovolny
Copy link
Member

martinpovolny commented Jul 22, 2017

@skateman : are you going to merge the changes here into Patternfly? Shall we close this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants