PAIR-code / facets

Visualizations for machine learning datasets
https://pair-code.github.io/facets/
Apache License 2.0
7.35k stars 887 forks source link

Questions about Facets structure and dependencies #233

Closed mauricioklein closed 3 years ago

mauricioklein commented 3 years ago

Hello!

I have some questions related to Facets (more specifically Facets Dive) that I couldn't get answered after checking the docs and source code:

  1. I see the project has dependencies with Tensorboard (this is evident checking the Bazel build scripts). What's the role of Tensorboard in the project? Since I saw D3 references in code as well, I'm wondering who's responsible for the data rendering and what's the role of Tensorboard and D3 in the project.

  2. Since Tensorboard is implemented using Polymer, is Polymer a hard requirement for Facets Dive? In other words, would it be possible to migrate Facets Dive to another framework, such as React for instance, and remove Polymer dependency?

Appreciate any clarification in this sense.

Thanks in advance!

jameswex commented 3 years ago

The deps on Tensorboard are just for the build scripts to build the project into its compiled form that make it usable both internal to Google and external as through its GitHub repo. That decision was made when Facets was first built, as getting it to build correctly in both environments and with its use of Typescript, Polymer, and Protocol Buffers was surprisingly complicated (and TensorBoard had solved it).

Facets Dive is rendered using Polymer 1.x elements and the THREE.js library (for the main display of dots/images Dive). Facets Overview is rendered using Polymer 1.x elements and the plottable.js library for chart creation/rendering (which is built on top of d3. Both visualizations make use of d3 as well.

Both visualizations are built as polymer web component elements (facets-dive and facets-overview), and internally make use of other polymer elements as sub-components. This was done as polymer elements were a popular choice for web component creation when Facets was developed, and at the time TensorBoard was all-in on Polymer.

Removing the Polymer dependency from Facets would require a complete rewrite of both visualizations and would be a breaking change for users of the elements. It isn't on our roadmap. But the creation of very similar visualizations could certainly be done through another framework (react or lit-element, for two examples).

mauricioklein commented 3 years ago

Thanks, appreciate your reply!