Coder Social home page Coder Social logo

techtothepeople / civisualize Goto Github PK

View Code? Open in Web Editor NEW
32.0 10.0 34.0 2.73 MB

CiviCRM vizualisation framework

Home Page: https://lab.civicrm.org/extensions/civisualize/

License: GNU Affero General Public License v3.0

PHP 25.39% CSS 0.48% JavaScript 6.80% Smarty 67.33%
civicrm civicrm-extension civicrm-extensions

civisualize's People

Contributors

anjaliujjainia avatar colemanw avatar deepak-srivastava avatar eileenmcnaughton avatar mattwire avatar michaelmcandrew avatar mlutfy avatar rthouvenin avatar scardinius avatar siddharthg avatar totten avatar tttp avatar vmantese avatar wintermoor avatar wmortada avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

civisualize's Issues

add sanity check to warn if extension url isn't properly set up

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+

Spelling mistake

image

Reported by one of our users. Should be "Monetary". Will push a fix.

Report hook working yet?

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.

Event Participants rowCount issue

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.

Dashlet content not appearing

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?

Gender selection fixed in code - not pulled out of database

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.

Unable to modify civisualize permissions: allows open access!

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?

Civisualize dashlets disappears

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

Event type chart on Events visualisation isn't displaying correctly

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:

var i = {crmAPI entity="OptionValue" option_group_id="14"}; {*todo on 4.4, use the event-type as id *}

JavaScript error civisualize-bundle Unexpected token '}'

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.

'var data' clashes with other javascript

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.

Events dataviz dashlet bug and breaking dashboard

This is happening

dashlet-dataviz

It also then breaks the dashboard configuration screen as follows:

dashboard-config

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

let several dataviz be used as dashlet

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:

  1. 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.

  2. if you have the same dom id in two dashlets and use them in your js, you got collission and bad stuffs happen

  3. 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:

  1. by convention, wrap all the html into a global div with id="dataviz-nameofthetemplate" eg. in Contact.tpl
<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>
  1. wrap all the js into a big
;(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

  • it makes it a bit harder to debug, not sure how to solve that one
  • if we were to allow in the future to insert the same dataviz twice (eg for two separate events) it would not work
  • some graphs are just too wide to fit into the narrow columns of the dashboard

civisualize links does not support non-clean URL in drupal.

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:

  • open /civisualize-master/templates/dataviz/event.pl
  • around line 341 I found and changed the URL encoding:
    // dynamic columns creation using an array of closures
    .columns([
    // non clean url form looks like "index.php?q=civicrm/dataviz/event/13"
    // original line: function(d) {return ""+d.title+""; },
    // added line for non-clean url support
    function(d) {return ""+d.title+""; },
    function(d) {return d.sd.getDate()+"/"+(d.sd.getMonth()+1)+"/"+d.sd.getFullYear();},
    function(d) {return d.ed.getDate()+"/"+(d.ed.getMonth()+1)+"/"+d.ed.getFullYear();},
    function(d) {return d.count;}
    ])
    .sortBy(function (d) {
    return d.sd;
    });

Mailings Broken

Recently this extension and started trying it out. The parts work are great! On my setup the Mailings report is empty. Screenshot attached. I'm running Civi 4.7.10 on WordPress 4.6.
screenshot 2016-08-26 14 39 11

Change 'monetory' to 'paid'

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.

CiviVisualise trying to inject its no 4 snippet into users dashboards on Drupal module enable?

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.

License clarification

There is no LICENSE or COPYING file for this project. I see the info.xml file and #66 indicates the license is AGPL.

If you would like me to submit a PR to make this easier, I would be happy to do that.

Wrapping it up and write the final report

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 :)

Single event report not working

The report for a single event seems to have stopped working with the latest update. This was working previously, but now no data is displayed.

Screen Shot 2019-11-06 at 17 31 51

Using CiviCRM 5.18 and Civisualize 5.0 with a standard civibuild dmaster site with demo data.

Joomla integration: Could not find valid value for q

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?

Customising the dashboard widget

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!

4.6 ready?

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 :-)

Dynamically get labels from option groups

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.

error on events and contacts dataviz

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

Bug report

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?

evenparticipants detail list contains much to much status

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.

Getting Started

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.

source graph on contacts isn't readable

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 ;)

Typo in Main.tpl

"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).

Mailings.tpl tries to load mailing.json that doesn't exist.

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.

NULL as a date causes problems

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

Contacts Source

Source page should show top 10 sources. We can use some other viz as well.

dc (and d3) upgrade?

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.