Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
davequinn
Contributor III
Contributor III

TypeError: Converting circular exporting extension to pdf

Hi,

I'm getting the following javascript error when i select Export to PDF on my d3 extension:

require.js:44 TypeError: Converting circular structure to JSON

    at JSON.stringify (<anonymous>)

    at Object.s [as formatSnapshotForRendering] (:4848/resources/assets/client/client.js??

I am following the instructions on help.qlik.com:

Properties includes this:

        support: {

          snapshot: true,

          export: true,

          exportData: true

        },   

and my Paint method ends with

return qlik.Promise.resolve();

Can anyone help?

Thanks,


Dave

1 Solution

Accepted Solutions
4 Replies
davequinn
Contributor III
Contributor III
Author

fyi: just noticed that i get the same error trying to take a Snapshot

Alexander_Thor
Employee
Employee

So what happens during both snapshot and exporting is that we take the current layout you have save it away as a snapshot or send it to the printing service.

Can you share a bit more code, such as the intialProperties.

Are you importing any unsupported internal Qlik modules?

davequinn
Contributor III
Contributor III
Author

Hi Alexander,

sure: heres the whole define piece. Hope it helps

define(["jquery", "text!./mystic-quadrant.css","./d3.v3.min", "./scatterUtils"], function($, cssContent) {'use strict';

    $("<style>").html(cssContent).appendTo("head");

    return {

        initialProperties : {

            version: 1.0,

            qHyperCubeDef : {               

                qDimensions : [],

                qMeasures : [],

                qInitialDataFetch : [{

                    qWidth : 4,

                    qHeight : 1000

                }]

            }

        },

        definition : {

            type : "items",

            component : "accordion",

            items : {

                dimensions : {

                    uses : "dimensions",

                    min : 1,

                    max: 1

                },

                measures : {

                    uses : "measures",

                    min : 3,

                    max: 3

                },

                sorting : {

                    uses : "sorting"

                },

                settings : {

                    uses : "settings",

  items: {

  labelSection: {

  type: "items",

  label: "Labels",

  items: {

  showDataLabels : {

  ref: "showDataLabels",

  label: "Data Labels",

  type: "boolean",

  component: "switch",

  options: [ {

  value: true,

  label: "Yes"

  }, {

  value: false,

  label: "No"

  }],

  defaultValue: true

  },

  showPopup : {

  ref: "showPopup",

  label: "Data Popup on Hover",

  type: "boolean",

  component: "switch",

  options: [ {

  value: true,

  label: "Yes"

  }, {

  value: false,

  label: "No"

  }],

  defaultValue: true

  },

  upperLeftLabel : {

  ref: "upperLeftLabel",

  label: "Upper Left Label",

  type: "string"

  },

  upperRightLabel : {

  ref: "upperRightLabel",

  label: "Upper Right Label",

  type: "string"

  },

  lowerLeftLabel : {

  ref: "lowerLeftLabel",

  label: "Lower Left Label",

  type: "string"

  },

  lowerRightLabel : {

  ref: "lowerRightLabel",

  label: "Lower Right Label",

  type: "string"

  }

  }

  },

  scaleDiameters : {

  ref: "scaleDiameters",

  label: "Auto Scale Diameters",

  type: "boolean",

  component: "switch",

  options: [ {

  value: true,

  label: "Yes"

  }, {

  value: false,

  label: "No"

  }],

  defaultValue: false

  },

  xAxisValue : {

  ref: "xAxisValue",

  label: "x Axis Value",

  type: "number",

  expression: "optional"

  },

  yAxisValue : {

  ref: "yAxisValue",

  label: "y Axis Value",

  type: "number",

  expression: "optional"

  },

  highlightDimension : {

  ref: "highlightDimension",

  label: "Highlight Dimension",

  type: "string",

  expression: "optional"

  },

  colourSection: {

  type: "items",

  label: "Colours",

  items: {

  colour : {

  ref: "dataColour",

  label: "Data Colour",

  type: "string",

  expression: "optional",

  defaultValue: "#3366cc"

  },

  bgColour : {

  ref: "bgColour",

  label: "Background Colour",

  type: "string",

  expression: "optional",

  defaultValue: "white"

  },

  labelColour : {

  ref: "labelColour",

  label: "Label Colour",

  type: "string",

  expression: "optional",

  defaultValue: "Gray"

  }

  }

  }

  }

  }

            }

        },

        support: {

          snapshot: true,

          export: true,

          exportData: true

        },       

        paint : function($element,layout) {  

            //console.log($element);

            //console.log(layout);

            var self = this; 

           

            senseUtils.extendLayout(layout, self);

           

            viz($element, layout, self);

       

        },

        resize:function($el,layout){

        this.paint($el,layout);

  return qlik.Promise.resolve();// needed for export to work

      }

    };

});

Alexander_Thor
Employee
Employee

Ah, you are using senseUtils.
See this issue: https://github.com/skokenes/senseUtils/issues/6