techtothepeople / civisualize Goto Github PK
View Code? Open in Web Editor NEWCiviCRM vizualisation framework
Home Page: https://lab.civicrm.org/extensions/civisualize/
License: GNU Affero General Public License v3.0
CiviCRM vizualisation framework
Home Page: https://lab.civicrm.org/extensions/civisualize/
License: GNU Affero General Public License v3.0
This error is found in file templates/dataviz/Contacts.tpl on row 67
@siddharthg
add is_deleted = 0 on your query with civicrm_contacts
This would fix that partly - but it will still include people added & then removed - not sure if anything other than a temp table can help with that
+++ b/api/v3/GroupContact/Getstat.php
@@ -1,8 +1,9 @@
This is happening
It also then breaks the dashboard configuration screen as follows:
It is not possible to select, move or delete anything on the above config screen.
Appears to be throwing this exception:
dc.errors.InvalidStateException
message: "Mandatory attribute chart.group is missing on chart[#participants]"
Can only then fix by deleting the dashlet and completely reloading the page.
Error originally occured on a new civi install with no events but the problem persisted even after events were created and participants added to the events.
Using CiviCRM 5.3
On the event detail page one gets a detailed list of the participants: name, gender, fee paid and status.,
However the list simply prints "all participants", not the "participants who will (likely) attend the event". It will display test users, deleted user,...
The query used is found in
/civisualize-master/queries/eventparticipants.json
------------------- begin json ----------------------
{"query":"SELECT contact.display_name, contact.birth_date, contact.contact_type, contact.gender_id, participant.status_id, participant.fee_amount, participant.fee_currency, participant.register_date from civicrm_participant as participant
INNER JOIN
civicrm_contact as contact on participant.contact_id = contact.id and contact.is_deleted=0
where participant.event_id=%1;","params":{"1":{"name":"eventid","type":"Integer"}}}
------------------ end json -----------------------------
It is a good ideau to exclude test users:
----------------- adapted json -------------------------
{"query":"SELECT contact.display_name, contact.birth_date, contact.contact_type, contact.gender_id, participant.status_id, participant.fee_amount, participant.fee_currency, participant.register_date from civicrm_participant as participant Im'
INNER JOIN
civicrm_contact as contact on participant.contact_id = contact.id and contact.is_deleted=0
where participant.event_id=%1 and participant.is_test=0","params":{"1":{"name":"eventid","type":"Integer"}}}
------------------- adapted json ------------------------------
I'm not familiar with query writing, but is should be a good idea to include the civi concept "count as participant". Only the status which count for the participants list should be shown here.
Regards
Johan.
Quick analysis:
the code for the dashboard is weird and a pita to debug (lots of caches, lots of unuseful ajax requests...).
it ajax loads separately every dashlet as html blobs and adds them to the dom of the page (directly, not as iframe).
When the dashlet generates the code, it isn't aware of the context of where the code will be embeded (eg it doesn't know in which column/position, the container div...). At least, I haven't found out that information.
so we have 3 issues with the way dashlets are done:
if you have a global js variable in the html you embed, it becomes a global variable for all the other dashlets. so if you use the same global variable into two different dashlets, you got collision and bad stuffs happen.
if you have the same dom id in two dashlets and use them in your js, you got collission and bad stuffs happen
it has to be designed for the size of the column, that we don't know in advance. beside doing it responsive (and that's not trivial with dc.js) don't know how to solve that one.
for the rest, I'd suggest the following conventions:
<div id="dataviz-contact">
<div id="xyz">that's where a graph will be inserted </div>
<div id="graph2">that's where another graph will be inserted...</div>
</div>
;(function(guid) {
//...
var chart= dc.pieChart(guid+"#xyz",guid); //we explicitely put the graphs into a group
var chart2=dc.barChart(guid+"#graph2",guid);
dc.renderAll(guid);
}("#dataviz-contact "));
that way no global variables.
problems left
I installed/enabled the extension on Civi 4.4.5 and the data/graphs do not display. It seems to be working on a local installation on Civi 4.5. Any thoughts?
It's a kind of weird situation, when after enabling Drupal module, I get "$ManagedEntities_failed"
with
[error_code] => constraint violation
[sql] =>
INSERT INTO civicrm_dashboard_contact ( dashboard_id, contact_id )
VALUES ( 6, 2 ), ( 6, 3 ), ( 6, 50 ), ( 6, 202 ), ( 6, 297 ), ( 6, 299 ), ( 6, 3678 ), ( 6, 8467 ), ( 6, 13538 ), ( 6, 68342 ), ( 6, 89067 ), ( 6, 117585 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`crm_civi`.`civicrm_dashboard_contact`, CONSTRAINT `FK_civicrm_dashboard_contact_dashboard_id` FOREIGN KEY (`dashboard_id`) REFERENCES `civicrm_dashboard` (`id`) ON DELETE CASCADE)]
I blame CiviVisualize because the api call is:
[entity] => Dashboard
[action] => create
[params] => Array
(
[id] => 6
[is_active] => 1
[version] => 3
[name] => dataviz_contact
[label] => Dataviz of contacts
[url] => /civicrm/dataviz/contacts?snippet=4
)
I'll investigate further.
loads that library by default
https://github.com/jmaister/excellentexport
and add examples on how to add the link to export?
With the 4.6 in beta since today i was wondering, do you foresee any issues with compatibility (or would you think this extension will have nog big issues working in 4.6? Of course I will also try and test myself, but you know the architecture of the extension and changes in civicrm better than I do :-)
Just curious where the ability to directly export data from a report (maybe via $rows) is? Not a big deal, would just be super handy.
Source page should show top 10 sources. We can use some other viz as well.
Checking with real data, it's at least as useful. not sure if it should replace or display both yet.
I've been unable to restrict access to civisualize. I tried altering the Menu file in civisualize/xml/Menu/civizualize.xml but it still seemed that anyone with access to civicrm could access the main page. This is a problem because Civisualize is able to pull data from across the database and users could see dashboards that they shouldn't. Is anyone able to restrict access to the dashboards?
I'd like to make a custom visualization with 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?
I also posted this question on Stack Exchange.
On the event view links are provided for upcomming events. These links are from the form "/event/". This works fine for clean URL. However if this option is not possible, links are broken.
Workaround: adapt the code a little bit:
i Guys,
Extension looks good, and very useful for a lot of people - thanks :)
I know this isn't a tech question, but where do I start to create visual reports on their own - so I have to code each pie chart to see them? and do they each go on their own site page?
Sorry for asking what is probably a stupid question, but I don't really see how to get started with making this work on a user level.
Cheers.
When you are viewing a specific event, their participants are limited to 25, even if there are hundreds. I tried changing a few api calls to have rowCount=0, but to no effect.
Events Page not showing anything if all the registration date lie in the same month.
On the events report there is a pie chart titled 'Type'. This should show a breakdown of the different types of event. Instead it shows a chart with just one value 'Host'.
Using CiviCRM 4.7.24 and Civisualize 1.62.
I think this is because the template has the option id hard coded as 14:
civisualize/templates/dataviz/Events.tpl
Line 61 in 8653250
I was hoping this was enabled - any chance it can be added to demo?
It seems it's a common pattern that the extension url isn't properly configured, so we don't load properly the d3 and dc and pals
It leads to a dataviz that is mostly empty, with no graph. Instead of expecting the users to check if there is a js error ("dc not an object" type), let's test it and display a proper error message
X+
so you have things like 1: 345 I know that 1 is female, but you should display the full gender, not only the id on the title as on the label.
Hi,
After adding Civisualize to my site I tried to open the default visualizations but when the page loaded none of the data showed up and there was a JavaScript error.
JavaScript error:
civisualize-bundle.e2342d8f6da25e9c0252b878e7997e7a.js:12 Uncaught SyntaxError: Unexpected token '}'
line 12 starts like:
else this._+='L'+(this._x1=t)+','+(this._y1=n);else},arc:function
It seems that the error is at the "else}". I believe the error is coming from the file:
eu.tttp.civisualize/js/d3.min.v5.7.0.js
at the part like: "else;},arc:function", I think there is something that is removing the semicolon when the civisualize-bundle file is created.
it shouldn't, only 'real' contributions
Hi,
When a civisualize dashlet is closed from "configure dashboard" area it disappears. How can we make it again available in the "configure dashboard" area so that users can select them for their dashboard? Many thanks,
Patrick
Are there chances to add the participant's role to event visualization?
When the database is incomplete/incorrect (eg. create_date missing) it generates an empty result (because js error).
Would be good to bulletproof a bit so it either provide sensible default values or at least display a clearer error message
Does the dashlet code work ok in 4.5.x? I can see the dashlets, but they don't load any content.
I can see they're trying to grab content from a snippet, but if I access the snippet directly I can see it doesn't have the includes for d3.js etc. so it throws a js error. Could this be stopping the content loading? Or is this perfectly normal?
Using Civicrm 4.6.5 and the latest master branch of Civizualize at github https://github.com/TechToThePeople/civisualize, The page /civicrm/dataviz shows the default visualizations list, but when I click on one of them, the vizualization does not render.
For screenshots, see http://civicrm.stackexchange.com/questions/4577/civizualize-does-not-render
I think it would make sense to dynamically get labels from option groups. For example, I was trying out the contribution trends sample and found that genderLabel was set to {1:"Male", 2:"Female"}. I ended up changing it to {1:"Female",2:"Male",3:"Transgender"} to match my civicrm option group.
I'm aware that this was just a sample. That said, it would be nice if there was built in functionality for this kind of thing. Another example would be to make date formats match the setting specified in Civicrm. I feel that changes like these would really help to integrate the data visualizations with Civicrm and make the extension much more robust.
It is an excellent extension as it is.
Please add copyright statement and license.
Ideally it would be great if you use an AGPL-3+ compatible license,
perhaps (A)GPL-3+, MIT (Expat) or Apache-2.0.
Thanks.
dc.js is at 3.0.10 at the time of writing and the version included here is 2.0.2
We also have d3 version 3.5.17, and that's up to 5.7.0
Is there anything holding back updating the libs?
var data = {crmSQL json="mailing"}; // this is looking for a non existent file. Should be 'mailings'
However, with civicrm 4.7 the json formatted sql snippets don't load up so we had to create mailings.sql (with just the sql part from mailing.json in it) instead to get the mailings visualisations to work.
Hi.
they are way too many different sources to make it useful. we might need to move to a wordcloud.
at least, write in black, as white on white doesn't work ;)
When I try to use the dataviz extension on our civicrm 4.4.6 site on joomla using:
administrator/?option=com_civicrm&task=civicrm/dataviz/contribute
we get a fatal error stating:
Sorry but we are not able to provide this at the moment.
Could not find valid value for q
Return to home page.
Is the extension currently drupal only or is this a small quick fixable quirk for you?
title says it all
Hi (non-coder here),
Love this extension but I'm trying to get the dashboard widget to just show only current FY April - March.
Any guidance on how to this?
Thanks!
Not sure how easy this is to fix - but we spotted on some sites they somehow had NULL date for a Contribution and that throws the x-axis back to year dot
also the year on the axis shows with a comma which is not ideal
Hi,
So it's finishing on monday (already!) and you need to write a final report. Check out the details, but you can re-use the content you wrote already in the blogs and the README. In fact, I'd rather see most of the doc in the wiki or the README rather than in a document only.
Check out the details of the instructions from google, and pen down time super soon :)
Hello Xavier,
Don't know what causes this, but is it awkward :-)
Civisualize. The missing data visualization extension (eu.tttp.civisualize) version 1.5 is installed. Upgrade to version 1.42.
"You need to choose one data visualisation. check you url."
Seems like the string "check you url." should be removed (I don't understand what that means / why it's on that line).
We have found that the variable
var data = {crmSQL file="donors"}; etc
clashes with other modules that also use a variable named 'data'
To get CiviVisualise working we have renamed all 'data' variables to 'data_viz'
Once I know which other JavaScript is clashing with CiviVisualize, i'll comment again here.
Problem: Event views shows wrong gender information if hard coded values in event.pl differ from database values.
In the file /templates/dataviz/event.pl around line 139 I found:
var genderLabel={"1":"Male","2":"Female"};
My database contains 2 = male, 1 female and 3 transgender.
Workaround: adapt the variable.
Thanks for developing a great extension! I have a minor suggestion to improve the language used in one of the reports.
The events visualisation report contains a graph titled: 'Is Monetory?' This is spelled incorrectly. It should be 'monetary' rather than 'monetory'. But rather than just correct the spelling, I would suggest that it would be better to change the title to 'Paid event' and change the other occurrences of 'monetory' to 'paid' throughout this report. I think that is simpler and clearer language.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.