gooddata

Is it possible to distinguish between an insight of type Pivot Table and an insight of type Table from the visualizationClass?


I'm working with the GoodData.UI SDK on version 6.3.2. I've got some code that looks up the type of an Insight given its visualizationClass object. When this code (or a separate lookup) gets the visualizationClass of an insight I've created with pivoting features, I get the following:

   "visualizationClass" : {
      "content" : {
         "checksum" : "local",
         "icon" : "local:table",
         "iconSelected" : "local:table.selected",
         "orderIndex" : 0.0,
         "url" : "local:table"
      },
      "meta" : {
         ...
         "identifier" : "gdc.visualization.table",
         "isProduction" : 1,
         "summary" : "",
         "tags" : "",
         "title" : "Table",
         ...
      }
   }
}

I'd expected there to be some indication here that this was a Pivot Table insight, rather than the older standard Table insight. I understand that going forward all tables will be pivot tables, but the documentation seems to indicate that both types of tables currently exist. Is there a way to distinguish these insight types from the visualizationClass that I'm missing, or is that not possible?

https://sdk.gooddata.com/gooddata-ui/docs/table_component.html https://sdk.gooddata.com/gooddata-ui/docs/pivot_table_component.html


Solution

  • Short answer
    It is not possible to distinguish between old Table and new PivotTable, because the visualizationClass is identical.

    Long answer
    The PivotTable was designed fully compatible with the older Table. The older Table is a subset of PivotTable functionalities. Thus, every Table is a PivotTable as well, and it is planned to drop the old Table support completely soon.

    You should assume that every table created with visualizationClass.content.url = 'local:table' is the new PivotTable.