Answers.Body: <p>So the general dc.js way is that you fetch all the data needed, and do the filtering client side.</p>
  
  <p>The usual way of doing the filtering is by clicking on the graphs, but you can as well have buttons on input filters, eg <a href="http://www.integritywatch.eu/" rel="nofollow noreferrer">http://www.integritywatch.eu/</a></p>
  
  <p>This being said, you could as well ajax fetch the data as csv or json, update the crossfilter and redraw the graphs. It might be easier to discuss about a specific example of what you want to do to work the pros and cons of each approach</p>
  
  <p>X+</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-12T10:20:33.787Z
Answers.LastActivityDate: 2017-04-12T10:20:33.787Z
Answers.UserDisplayName: Xavier
Answers.Body: <p>I had some need to be able to do that: on the first step, you have a list of campaign, and on the second one, you have the visualisation for the specific campaign. The trick is to see them as two different dataviz (list of campaign, detail of a specific campaign) with two diffent .tpl</p>
  
  <p>For the second one, you can put in the url the user input (eg the campaign id), so for instance if your url is example.org/civicrm/dataviz/campaign/42 civisualize automatically assign {id} and you can read it from Campaign.tpl</p>
  
  <p>So to finish the campaign example, you would have two urls example.org/civicrm/dataviz/campaign that uses Campaign.tpl and contains:</p>
  
  <pre><code>{crmTitle string="All campaigns"}
  {if isset($id)}
  Display the details of a campaign
    {include file='dataviz/_campaign_detail.tpl'}
  {else}
    {include file='dataviz/_campaign_selector.tpl'}
  Display the list of campaigns with urls to /dataviz/campaign/campaign_id
   {/if}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-08T16:04:51.077Z
Answers.LastActivityDate: 2018-02-08T16:04:51.077Z
Answers.UserDisplayName: Xavier
Body: <p>I'd like to make a custom visualization with <a href="https://github.com/TechToThePeople/civisualize" rel="nofollow noreferrer">Civisualize</a> but the visualization requires the user to first provide some input through several form elements. None of the visualizations that I see within Civisualize allow for any user input. Is this possible with Civisualize? </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-22T07:34:35.387Z
Comments.Text: The data for visualization you are looking for from the user, is it to filter data,  or you want the data to be fetched from the server according to this data?
Comments.UserDisplayName: Siddharth Gupta
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-22T15:18:45.693Z
Comments.Text: "Data to be fetched from the server according to inputs"
Comments.UserDisplayName: Sean
Tags: <civireport><reports><custom-reports><civisualize>
Title: How to supply user input to custom visualizations with Civisualize
ThreadText: # How to supply user input to custom visualizations with Civisualize
  
  (Asked by: username_0 on 2017-02-09)
  
  I'd like to make a custom visualization with [Civisualize](https://github.com/TechToThePeople/civisualize) but the visualization requires the user to first provide some input through several form elements. None of the visualizations that I see within Civisualize allow for any user input. Is this possible with Civisualize?
  
  **Tags:** civireport, reports, custom-reports, civisualize
  
  > **Comments:**
  > **username_1**: The data for visualization you are looking for from the user, is it to filter data,  or you want the data to be fetched from the server according to this data?  
  > **username_0**: "Data to be fetched from the server according to inputs"  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2017-04-12. Score: 1
  
  So the general dc.js way is that you fetch all the data needed, and do the filtering client side.
  
  The usual way of doing the filtering is by clicking on the graphs, but you can as well have buttons on input filters, eg <http://www.integritywatch.eu/>
  
  This being said, you could as well ajax fetch the data as csv or json, update the crossfilter and redraw the graphs. It might be easier to discuss about a specific example of what you want to do to work the pros and cons of each approach
  
  X+
  
  
  ---
  
  ### Answer by username_2 on 2018-02-08. Score: 0
  
  I had some need to be able to do that: on the first step, you have a list of campaign, and on the second one, you have the visualisation for the specific campaign. The trick is to see them as two different dataviz (list of campaign, detail of a specific campaign) with two diffent .tpl
  For the second one, you can put in the url the user input (eg the campaign id), so for instance if your url is example.org/civicrm/dataviz/campaign/42 civisualize automatically assign {id} and you can read it from Campaign.tpl
  So to finish the campaign example, you would have two urls example.org/civicrm/dataviz/campaign that uses Campaign.tpl and contains:
  {crmTitle string="All campaigns"}
  {if isset($id)}
  Display the details of a campaign
    {include file='dataviz/_campaign_detail.tpl'}
  {else}
    {include file='dataviz/_campaign_selector.tpl'}
  Display the list of campaigns with urls to /dataviz/campaign/campaign_id
   {/if}
  
  
  ---
  
  