Documentation for d2 library

To speak in favour of it, it is the “future” way of doing stuff, as it’s basically follows the new standard way of javascript modules (Not webpack obviously, but the ES2016/ES2017 specs).

Anyways, since 2.24 is out i should have some time to look into this. Might take a few days though, so until then you’ll wait. Since we have not maintained that stand alone build for a while, i can not estimate how long it will take me to get it back into shape.

···

On Tue, Jul 5, 2016 at 7:43 AM, Sultanahamar Mohammad sultanm@thoughtworks.com wrote:

Hi Mark,

Can we have d2 library without having to depend on webpack, babel and stuff around. A plane js file upon including it, exposes its method on window object may be with a namespace d2. That should make it very easy to people who want to try d2. Right now, people should start understanding webpack, exports and stuff around it.

I think dhis has put effort in doing so with d2-browser.js but its not working as expected. If you can just fix that, it should be very helpful for the community.

Regards,

Sultan Ahamar.

On Mon, Jul 4, 2016 at 6:41 PM, Mark Polak mark@dhis2.org wrote:

The idea is so simplify the workflow for translators, which means that we’re changing the way the translations are implemented and will likely move from a key based system to a getText style of workflow.

So translations as they currently work are working fine (you can see examples in the other apps too) But in the future we’ll move away from parsing the client side .properties files (yes i know it’s kind of weird … :)). To be more concrete the idea is to have something more like d2.i18n.getTranslation('This is my title') which renders the english text if no translation is available or the language should be english instead of d2.i18n.getTranslation('this_is_my_title') where we need to map the key to English. (There is a long story behind which is not really important, but if you’re interested it is explained in detail in a google doc [1])

For your AngularJS implementation i created a simple example on how such a thing could be achieved. Obviously you would probably not inject d2 into the controller like i’ve done in the example and make it look somewhat cleaner with factories/services that provide the controllers with the data but the idea behind it should be clear :wink:

Hope this helps:
https://github.com/Markionium/d2-angular-webpack

[1] https://docs.google.com/document/d/1u0YhRZD2Q3F8p6VCsz7dXdZxJL45R0qsEfsNc0OCJYs/edit#heading=h.7x8a17q7igji


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Mon, Jul 4, 2016 at 2:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you for the detailed response. Could you elaborate on “Reworking the translation support”.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:53 PM, Mark Polak mark@dhis2.org wrote:

To come back to your earlier questions, which you’ve said you’ve mostly found the answers too :wink:

Loading multiple layers of objects example
https://github.com/Markionium/d2-examples/blob/master/src/deeperModels/index.js

Filtering:
https://github.com/Markionium/d2-examples/blob/master/src/filtering/index.js

Roadmap:

The roadmap for this stuff basically depends on what we need for the stuff we’re currently working on.
What is on the list currently that are major things:

  • fixing PATCH for updates when it is supported in the api.
  • Reworking the translation support
  • Reducing the footprint of the /api/schemas endpoint that gets loaded
  • Batch updates/saves
  • Getting rid of the jQuery dependency

If you find yourself missing something though, you could always contribute or open an issue and we can judge if it is worth adding. :slight_smile:

Further long term, we would like to merge d2 and d2-analysis and implement offline support to a certain degree (to meet the tracker use cases) but both of these are likely not any time soon.

I don’t know much about the d2-analysis and what it supports (there is no documentation yet as far as i’m aware). It can be used with the all the things like charts and maps as thats what we use it for, to power GIS, pivot and friends. Those apps on github must have code that sort of explains how to use it :wink:

Good to know you’re using webpack, that should make it easier :wink: Stay tuned

On Mon, Jul 4, 2016 at 2:19 PM, Archana Chillala archanac@thoughtworks.com wrote:

Yes, we’ll be using webpack.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:14 PM, Mark Polak mark@dhis2.org wrote:

That might be a bit outdated :slight_smile:

Are you using any tools like webpack or babel?

On Mon, Jul 4, 2016 at 1:06 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Sure. Thanks a lot. From the existing apps that are leveraging d2, we have figured out how to use filters and also to retrieve multiple fields and their inner objects as well.

But we have an issue. We have our custom apps written in angularJS and want to use d2 library with it.

As mentioned in the documentation (http://d2.markionium.com), we tried the following.

If you want to use d2 as just a global variable on the window object you can include one of the following scripts in your page d2/lib/d2-browser.js or d2/lib/d2-browser.min.js

But, we are not able to access d2. Is there something we are missing?

Any help here is appreciated.

*Cheers,*


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 2:19 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

I’m working on after finishing a few things for the 2.24 release. Should get you an answer today with some examples. :slight_smile:

Regards,

Mark

On Mon, Jul 4, 2016 at 9:08 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

Could you please provide any information on the above-mentioned queries.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 6:47 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We also came across, d2-analysis library (https://github.com/dhis2/d2-analysis). Is there any documentation about it and how to use it? Can it be used for all the analytics objects (e.g. charts, pivot tables, event charts, event reports)

Regarding the d2 library, could you please let us know its roadmap and what are the features that will be incorporated.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 5:58 PM, Archana Chillala archanac@thoughtworks.com wrote:

Also, could you please share some examples on how to use filters.

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 4:49 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

We want to retrieve data in a format specified as shown below.

http://localhost:8080/api/dataSets.json?fields=name,id,sections[name,dataElements[id,name,valueType]]

which renders this:

  • dataSets:

[

  • {
    • name: “data set”,
- id: "m0rnaeivV6W",
- sections:
  [
  - {
    - name: "Section1",
    - dataElements:
      [
      - {
        - name: "new data element",
        - id: "JyjMOr3En81",
        - valueType: "NUMBER"
        }
      ]
    }
  ]
}

]

Is there any d2 alternative to replicate the same? Or do we have to first get all dataElements and then after getting a dataSet filter from dataElements?

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 7:20 PM, Mark Polak mark@dhis2.org wrote:

Sorry silly me, forgot to include the link :wink:

https://github.com/dhis2/app-skeleton

On Wed, Jun 29, 2016 at 3:28 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Thank you. Could you share a link to the skeleton app you mentioned.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 5:43 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

If you’re still starting to use the tools before that feel free to ask questions on the list or through github issues on the specific repositories and we’ll try to help you as best as we can.

In the mean time you could take a look at our skeleton app. It has a very basic setup of the libraries Nicolay mentioned and a few comments on what is happening :wink:

Regards,

Mark

On Wed, Jun 29, 2016 at 1:22 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thanks a lot, Lars.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 4:25 PM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Archana,

we definitely plan to improve the docs and provide a consistent set of documentation / guides - we just hadn’t had the time yet but its high on our list after 2.24.

regards,

Lars

On Wed, Jun 29, 2016 at 12:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you, Nicolay.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 2:43 PM, Nicolay Ramm nicolay@dhis2.org wrote:

Hi Archana,

unfortunately the documentation that currently exists for D2 is far from extensive. The limited documentation we have can be found here: http://d2.markionium.com

This is generated from the source code, so you’ll find the same documentation in the code itself.

The following apps are written using D2, D2-UI, React and RxJS:

Best regards,

Nicolay Ramm

Front end developer, DHIS 2

University of Oslo

https://www.dhis2.org

On Wed, Jun 29, 2016 at 10:58 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi devs,

We are looking at using d2 library for our custom apps. Could you please direct us to any extensive documentation available for the same. Also, could you please share with us (repo links for) any apps built on react, so we could understand how d2 has been used.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Hi Mark,

Thanks for your response. Really appreciate it. We would like to understand d2 a little deeper. Could you please answer the following queries:

  • What is it that d2 offers? What are the benefits over making plain API calls.

  • When d2 library is upgraded or if the API endpoints are changed, how does it affect the d2 models and the apps that use models. Say, we have custom apps, built using d2 version 24 and DHIS2 version 2.24, when we move to DHIS2 version 2.25, how compatible is d2 v24 with the new version of DHIS2? And what are the repercussions that come with it.

  • We see a lot of frequent releases on github. Since the model is dynamically built using DHIS schema, what is it that is being added to each release?

  • What is the release cycle of d2 library. If d2 version 25 is released, would it be after DHIS2 release of version 25? How are d2 and DHIS2 releases associated? And how is the relevant d2 library affected.

  • Is it possible to load the models from some other sources (like Indexed DB)

  • How flexible is D2 library in handling huge data models? Currently, when we make a call, we get the complete model object. If there is a huge data model, then it might cause performance issues. Is there any way to “not” get the complete model?

  • Do you back-port bug fixes to previous versions of d2? If so, till how many versions backwards?

  • What is the bug cycle like? When issues are raised, how soon are the bugs going to be fixed??

  • If we go ahead with using d2 library, what is the stable version you might want to suggest?

Thanks,

···

On Tue, Jul 5, 2016 at 12:57 PM, Mark Polak mark@dhis2.org wrote:

To speak in favour of it, it is the “future” way of doing stuff, as it’s basically follows the new standard way of javascript modules (Not webpack obviously, but the ES2016/ES2017 specs).

Anyways, since 2.24 is out i should have some time to look into this. Might take a few days though, so until then you’ll wait. Since we have not maintained that stand alone build for a while, i can not estimate how long it will take me to get it back into shape.

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Tue, Jul 5, 2016 at 7:43 AM, Sultanahamar Mohammad sultanm@thoughtworks.com wrote:

Hi Mark,

Can we have d2 library without having to depend on webpack, babel and stuff around. A plane js file upon including it, exposes its method on window object may be with a namespace d2. That should make it very easy to people who want to try d2. Right now, people should start understanding webpack, exports and stuff around it.

I think dhis has put effort in doing so with d2-browser.js but its not working as expected. If you can just fix that, it should be very helpful for the community.

Regards,

Sultan Ahamar.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

On Mon, Jul 4, 2016 at 6:41 PM, Mark Polak mark@dhis2.org wrote:

The idea is so simplify the workflow for translators, which means that we’re changing the way the translations are implemented and will likely move from a key based system to a getText style of workflow.

So translations as they currently work are working fine (you can see examples in the other apps too) But in the future we’ll move away from parsing the client side .properties files (yes i know it’s kind of weird … :)). To be more concrete the idea is to have something more like d2.i18n.getTranslation('This is my title') which renders the english text if no translation is available or the language should be english instead of d2.i18n.getTranslation('this_is_my_title') where we need to map the key to English. (There is a long story behind which is not really important, but if you’re interested it is explained in detail in a google doc [1])

For your AngularJS implementation i created a simple example on how such a thing could be achieved. Obviously you would probably not inject d2 into the controller like i’ve done in the example and make it look somewhat cleaner with factories/services that provide the controllers with the data but the idea behind it should be clear :wink:

Hope this helps:
https://github.com/Markionium/d2-angular-webpack

[1] https://docs.google.com/document/d/1u0YhRZD2Q3F8p6VCsz7dXdZxJL45R0qsEfsNc0OCJYs/edit#heading=h.7x8a17q7igji


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Mon, Jul 4, 2016 at 2:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you for the detailed response. Could you elaborate on “Reworking the translation support”.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:53 PM, Mark Polak mark@dhis2.org wrote:

To come back to your earlier questions, which you’ve said you’ve mostly found the answers too :wink:

Loading multiple layers of objects example
https://github.com/Markionium/d2-examples/blob/master/src/deeperModels/index.js

Filtering:
https://github.com/Markionium/d2-examples/blob/master/src/filtering/index.js

Roadmap:

The roadmap for this stuff basically depends on what we need for the stuff we’re currently working on.
What is on the list currently that are major things:

  • fixing PATCH for updates when it is supported in the api.
  • Reworking the translation support
  • Reducing the footprint of the /api/schemas endpoint that gets loaded
  • Batch updates/saves
  • Getting rid of the jQuery dependency

If you find yourself missing something though, you could always contribute or open an issue and we can judge if it is worth adding. :slight_smile:

Further long term, we would like to merge d2 and d2-analysis and implement offline support to a certain degree (to meet the tracker use cases) but both of these are likely not any time soon.

I don’t know much about the d2-analysis and what it supports (there is no documentation yet as far as i’m aware). It can be used with the all the things like charts and maps as thats what we use it for, to power GIS, pivot and friends. Those apps on github must have code that sort of explains how to use it :wink:

Good to know you’re using webpack, that should make it easier :wink: Stay tuned

On Mon, Jul 4, 2016 at 2:19 PM, Archana Chillala archanac@thoughtworks.com wrote:

Yes, we’ll be using webpack.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:14 PM, Mark Polak mark@dhis2.org wrote:

That might be a bit outdated :slight_smile:

Are you using any tools like webpack or babel?

On Mon, Jul 4, 2016 at 1:06 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Sure. Thanks a lot. From the existing apps that are leveraging d2, we have figured out how to use filters and also to retrieve multiple fields and their inner objects as well.

But we have an issue. We have our custom apps written in angularJS and want to use d2 library with it.

As mentioned in the documentation (http://d2.markionium.com), we tried the following.

If you want to use d2 as just a global variable on the window object you can include one of the following scripts in your page d2/lib/d2-browser.js or d2/lib/d2-browser.min.js

But, we are not able to access d2. Is there something we are missing?

Any help here is appreciated.

*Cheers,*


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 2:19 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

I’m working on after finishing a few things for the 2.24 release. Should get you an answer today with some examples. :slight_smile:

Regards,

Mark

On Mon, Jul 4, 2016 at 9:08 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

Could you please provide any information on the above-mentioned queries.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 6:47 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We also came across, d2-analysis library (https://github.com/dhis2/d2-analysis). Is there any documentation about it and how to use it? Can it be used for all the analytics objects (e.g. charts, pivot tables, event charts, event reports)

Regarding the d2 library, could you please let us know its roadmap and what are the features that will be incorporated.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 5:58 PM, Archana Chillala archanac@thoughtworks.com wrote:

Also, could you please share some examples on how to use filters.

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 4:49 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

We want to retrieve data in a format specified as shown below.

http://localhost:8080/api/dataSets.json?fields=name,id,sections[name,dataElements[id,name,valueType]]

which renders this:

  • dataSets:

[

  • {
    • name: “data set”,
- id: "m0rnaeivV6W",
- sections:
  [
  - {
    - name: "Section1",
    - dataElements:
      [
      - {
        - name: "new data element",
        - id: "JyjMOr3En81",
        - valueType: "NUMBER"
        }
      ]
    }
  ]
}

]

Is there any d2 alternative to replicate the same? Or do we have to first get all dataElements and then after getting a dataSet filter from dataElements?

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 7:20 PM, Mark Polak mark@dhis2.org wrote:

Sorry silly me, forgot to include the link :wink:

https://github.com/dhis2/app-skeleton

On Wed, Jun 29, 2016 at 3:28 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Thank you. Could you share a link to the skeleton app you mentioned.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 5:43 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

If you’re still starting to use the tools before that feel free to ask questions on the list or through github issues on the specific repositories and we’ll try to help you as best as we can.

In the mean time you could take a look at our skeleton app. It has a very basic setup of the libraries Nicolay mentioned and a few comments on what is happening :wink:

Regards,

Mark

On Wed, Jun 29, 2016 at 1:22 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thanks a lot, Lars.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 4:25 PM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Archana,

we definitely plan to improve the docs and provide a consistent set of documentation / guides - we just hadn’t had the time yet but its high on our list after 2.24.

regards,

Lars

On Wed, Jun 29, 2016 at 12:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you, Nicolay.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 2:43 PM, Nicolay Ramm nicolay@dhis2.org wrote:

Hi Archana,

unfortunately the documentation that currently exists for D2 is far from extensive. The limited documentation we have can be found here: http://d2.markionium.com

This is generated from the source code, so you’ll find the same documentation in the code itself.

The following apps are written using D2, D2-UI, React and RxJS:

Best regards,

Nicolay Ramm

Front end developer, DHIS 2

University of Oslo

https://www.dhis2.org

On Wed, Jun 29, 2016 at 10:58 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi devs,

We are looking at using d2 library for our custom apps. Could you please direct us to any extensive documentation available for the same. Also, could you please share with us (repo links for) any apps built on react, so we could understand how d2 has been used.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hey Archana,

You raise a lot of interesting questions. Some of which we have considered and some which we might not have as much. First you’ll have to realise that it’s not officially been released yet, so all these things have not been ironed out yet.

Currently we are the only major users of the library in our down core apps, but with you guys showing interest that obviously changes, and we’d want to support that effort as best as we can.
So before giving you a elaborate response on this, i’d like to hear from you guys, what you would want it, as in features and support from our side.

The release cycle as it has been recently decided is that d2 would have a version that follows the DHIS2 version. (There is some api versioning in the works that should, in principle guarantee your d2 version for 24 to work with /api/24 in DHIS2 2.25 and DHIS2 2.26, while api versioning has not been officially released with 2.24, it is available in 2.24).

We’ll discuss your list tomorrow morning.

···

On Tue, Jul 5, 2016 at 3:53 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Thanks for your response. Really appreciate it. We would like to understand d2 a little deeper. Could you please answer the following queries:

  • What is it that d2 offers? What are the benefits over making plain API calls.
  • When d2 library is upgraded or if the API endpoints are changed, how does it affect the d2 models and the apps that use models. Say, we have custom apps, built using d2 version 24 and DHIS2 version 2.24, when we move to DHIS2 version 2.25, how compatible is d2 v24 with the new version of DHIS2? And what are the repercussions that come with it.
  • We see a lot of frequent releases on github. Since the model is dynamically built using DHIS schema, what is it that is being added to each release?
  • What is the release cycle of d2 library. If d2 version 25 is released, would it be after DHIS2 release of version 25? How are d2 and DHIS2 releases associated? And how is the relevant d2 library affected.
  • Is it possible to load the models from some other sources (like Indexed DB)
  • How flexible is D2 library in handling huge data models? Currently, when we make a call, we get the complete model object. If there is a huge data model, then it might cause performance issues. Is there any way to “not” get the complete model?
  • Do you back-port bug fixes to previous versions of d2? If so, till how many versions backwards?
  • What is the bug cycle like? When issues are raised, how soon are the bugs going to be fixed??
  • If we go ahead with using d2 library, what is the stable version you might want to suggest?

Thanks,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Tue, Jul 5, 2016 at 12:57 PM, Mark Polak mark@dhis2.org wrote:

To speak in favour of it, it is the “future” way of doing stuff, as it’s basically follows the new standard way of javascript modules (Not webpack obviously, but the ES2016/ES2017 specs).

Anyways, since 2.24 is out i should have some time to look into this. Might take a few days though, so until then you’ll wait. Since we have not maintained that stand alone build for a while, i can not estimate how long it will take me to get it back into shape.

On Tue, Jul 5, 2016 at 7:43 AM, Sultanahamar Mohammad sultanm@thoughtworks.com wrote:

Hi Mark,

Can we have d2 library without having to depend on webpack, babel and stuff around. A plane js file upon including it, exposes its method on window object may be with a namespace d2. That should make it very easy to people who want to try d2. Right now, people should start understanding webpack, exports and stuff around it.

I think dhis has put effort in doing so with d2-browser.js but its not working as expected. If you can just fix that, it should be very helpful for the community.

Regards,

Sultan Ahamar.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

On Mon, Jul 4, 2016 at 6:41 PM, Mark Polak mark@dhis2.org wrote:

The idea is so simplify the workflow for translators, which means that we’re changing the way the translations are implemented and will likely move from a key based system to a getText style of workflow.

So translations as they currently work are working fine (you can see examples in the other apps too) But in the future we’ll move away from parsing the client side .properties files (yes i know it’s kind of weird … :)). To be more concrete the idea is to have something more like d2.i18n.getTranslation('This is my title') which renders the english text if no translation is available or the language should be english instead of d2.i18n.getTranslation('this_is_my_title') where we need to map the key to English. (There is a long story behind which is not really important, but if you’re interested it is explained in detail in a google doc [1])

For your AngularJS implementation i created a simple example on how such a thing could be achieved. Obviously you would probably not inject d2 into the controller like i’ve done in the example and make it look somewhat cleaner with factories/services that provide the controllers with the data but the idea behind it should be clear :wink:

Hope this helps:
https://github.com/Markionium/d2-angular-webpack

[1] https://docs.google.com/document/d/1u0YhRZD2Q3F8p6VCsz7dXdZxJL45R0qsEfsNc0OCJYs/edit#heading=h.7x8a17q7igji


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Mon, Jul 4, 2016 at 2:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you for the detailed response. Could you elaborate on “Reworking the translation support”.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:53 PM, Mark Polak mark@dhis2.org wrote:

To come back to your earlier questions, which you’ve said you’ve mostly found the answers too :wink:

Loading multiple layers of objects example
https://github.com/Markionium/d2-examples/blob/master/src/deeperModels/index.js

Filtering:
https://github.com/Markionium/d2-examples/blob/master/src/filtering/index.js

Roadmap:

The roadmap for this stuff basically depends on what we need for the stuff we’re currently working on.
What is on the list currently that are major things:

  • fixing PATCH for updates when it is supported in the api.
  • Reworking the translation support
  • Reducing the footprint of the /api/schemas endpoint that gets loaded
  • Batch updates/saves
  • Getting rid of the jQuery dependency

If you find yourself missing something though, you could always contribute or open an issue and we can judge if it is worth adding. :slight_smile:

Further long term, we would like to merge d2 and d2-analysis and implement offline support to a certain degree (to meet the tracker use cases) but both of these are likely not any time soon.

I don’t know much about the d2-analysis and what it supports (there is no documentation yet as far as i’m aware). It can be used with the all the things like charts and maps as thats what we use it for, to power GIS, pivot and friends. Those apps on github must have code that sort of explains how to use it :wink:

Good to know you’re using webpack, that should make it easier :wink: Stay tuned

On Mon, Jul 4, 2016 at 2:19 PM, Archana Chillala archanac@thoughtworks.com wrote:

Yes, we’ll be using webpack.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:14 PM, Mark Polak mark@dhis2.org wrote:

That might be a bit outdated :slight_smile:

Are you using any tools like webpack or babel?

On Mon, Jul 4, 2016 at 1:06 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Sure. Thanks a lot. From the existing apps that are leveraging d2, we have figured out how to use filters and also to retrieve multiple fields and their inner objects as well.

But we have an issue. We have our custom apps written in angularJS and want to use d2 library with it.

As mentioned in the documentation (http://d2.markionium.com), we tried the following.

If you want to use d2 as just a global variable on the window object you can include one of the following scripts in your page d2/lib/d2-browser.js or d2/lib/d2-browser.min.js

But, we are not able to access d2. Is there something we are missing?

Any help here is appreciated.

*Cheers,*


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 2:19 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

I’m working on after finishing a few things for the 2.24 release. Should get you an answer today with some examples. :slight_smile:

Regards,

Mark

On Mon, Jul 4, 2016 at 9:08 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

Could you please provide any information on the above-mentioned queries.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 6:47 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We also came across, d2-analysis library (https://github.com/dhis2/d2-analysis). Is there any documentation about it and how to use it? Can it be used for all the analytics objects (e.g. charts, pivot tables, event charts, event reports)

Regarding the d2 library, could you please let us know its roadmap and what are the features that will be incorporated.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 5:58 PM, Archana Chillala archanac@thoughtworks.com wrote:

Also, could you please share some examples on how to use filters.

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 4:49 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

We want to retrieve data in a format specified as shown below.

http://localhost:8080/api/dataSets.json?fields=name,id,sections[name,dataElements[id,name,valueType]]

which renders this:

  • dataSets:

[

  • {
    • name: “data set”,
- id: "m0rnaeivV6W",
- sections:
  [
  - {
    - name: "Section1",
    - dataElements:
      [
      - {
        - name: "new data element",
        - id: "JyjMOr3En81",
        - valueType: "NUMBER"
        }
      ]
    }
  ]
}

]

Is there any d2 alternative to replicate the same? Or do we have to first get all dataElements and then after getting a dataSet filter from dataElements?

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 7:20 PM, Mark Polak mark@dhis2.org wrote:

Sorry silly me, forgot to include the link :wink:

https://github.com/dhis2/app-skeleton

On Wed, Jun 29, 2016 at 3:28 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Thank you. Could you share a link to the skeleton app you mentioned.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 5:43 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

If you’re still starting to use the tools before that feel free to ask questions on the list or through github issues on the specific repositories and we’ll try to help you as best as we can.

In the mean time you could take a look at our skeleton app. It has a very basic setup of the libraries Nicolay mentioned and a few comments on what is happening :wink:

Regards,

Mark

On Wed, Jun 29, 2016 at 1:22 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thanks a lot, Lars.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 4:25 PM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Archana,

we definitely plan to improve the docs and provide a consistent set of documentation / guides - we just hadn’t had the time yet but its high on our list after 2.24.

regards,

Lars

On Wed, Jun 29, 2016 at 12:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you, Nicolay.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 2:43 PM, Nicolay Ramm nicolay@dhis2.org wrote:

Hi Archana,

unfortunately the documentation that currently exists for D2 is far from extensive. The limited documentation we have can be found here: http://d2.markionium.com

This is generated from the source code, so you’ll find the same documentation in the code itself.

The following apps are written using D2, D2-UI, React and RxJS:

Best regards,

Nicolay Ramm

Front end developer, DHIS 2

University of Oslo

https://www.dhis2.org

On Wed, Jun 29, 2016 at 10:58 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi devs,

We are looking at using d2 library for our custom apps. Could you please direct us to any extensive documentation available for the same. Also, could you please share with us (repo links for) any apps built on react, so we could understand how d2 has been used.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Hey Sultan Ahamar,

I’ve fixed the stand alone builds and redeployed to npm.

If you’re developing for dhis 2.23 or lower (or dhis 2.24 with the old importer) use npm install d2@dhis-2.23
If you’re developing for 2.24 with the new importer use npm install d2@dhis-2.24 (To use the new importer you’ve got to set your dhis2 base url to <domain>/api/24

See a simple reference example here https://github.com/Markionium/d2-example-standalone

Let me know if you run into any issues.

···

On Tue, Jul 5, 2016 at 7:43 AM, Sultanahamar Mohammad sultanm@thoughtworks.com wrote:

Hi Mark,

Can we have d2 library without having to depend on webpack, babel and stuff around. A plane js file upon including it, exposes its method on window object may be with a namespace d2. That should make it very easy to people who want to try d2. Right now, people should start understanding webpack, exports and stuff around it.

I think dhis has put effort in doing so with d2-browser.js but its not working as expected. If you can just fix that, it should be very helpful for the community.

Regards,

Sultan Ahamar.

On Mon, Jul 4, 2016 at 6:41 PM, Mark Polak mark@dhis2.org wrote:

The idea is so simplify the workflow for translators, which means that we’re changing the way the translations are implemented and will likely move from a key based system to a getText style of workflow.

So translations as they currently work are working fine (you can see examples in the other apps too) But in the future we’ll move away from parsing the client side .properties files (yes i know it’s kind of weird … :)). To be more concrete the idea is to have something more like d2.i18n.getTranslation('This is my title') which renders the english text if no translation is available or the language should be english instead of d2.i18n.getTranslation('this_is_my_title') where we need to map the key to English. (There is a long story behind which is not really important, but if you’re interested it is explained in detail in a google doc [1])

For your AngularJS implementation i created a simple example on how such a thing could be achieved. Obviously you would probably not inject d2 into the controller like i’ve done in the example and make it look somewhat cleaner with factories/services that provide the controllers with the data but the idea behind it should be clear :wink:

Hope this helps:
https://github.com/Markionium/d2-angular-webpack

[1] https://docs.google.com/document/d/1u0YhRZD2Q3F8p6VCsz7dXdZxJL45R0qsEfsNc0OCJYs/edit#heading=h.7x8a17q7igji


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Mon, Jul 4, 2016 at 2:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you for the detailed response. Could you elaborate on “Reworking the translation support”.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:53 PM, Mark Polak mark@dhis2.org wrote:

To come back to your earlier questions, which you’ve said you’ve mostly found the answers too :wink:

Loading multiple layers of objects example
https://github.com/Markionium/d2-examples/blob/master/src/deeperModels/index.js

Filtering:
https://github.com/Markionium/d2-examples/blob/master/src/filtering/index.js

Roadmap:

The roadmap for this stuff basically depends on what we need for the stuff we’re currently working on.
What is on the list currently that are major things:

  • fixing PATCH for updates when it is supported in the api.
  • Reworking the translation support
  • Reducing the footprint of the /api/schemas endpoint that gets loaded
  • Batch updates/saves
  • Getting rid of the jQuery dependency

If you find yourself missing something though, you could always contribute or open an issue and we can judge if it is worth adding. :slight_smile:

Further long term, we would like to merge d2 and d2-analysis and implement offline support to a certain degree (to meet the tracker use cases) but both of these are likely not any time soon.

I don’t know much about the d2-analysis and what it supports (there is no documentation yet as far as i’m aware). It can be used with the all the things like charts and maps as thats what we use it for, to power GIS, pivot and friends. Those apps on github must have code that sort of explains how to use it :wink:

Good to know you’re using webpack, that should make it easier :wink: Stay tuned

On Mon, Jul 4, 2016 at 2:19 PM, Archana Chillala archanac@thoughtworks.com wrote:

Yes, we’ll be using webpack.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:14 PM, Mark Polak mark@dhis2.org wrote:

That might be a bit outdated :slight_smile:

Are you using any tools like webpack or babel?

On Mon, Jul 4, 2016 at 1:06 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Sure. Thanks a lot. From the existing apps that are leveraging d2, we have figured out how to use filters and also to retrieve multiple fields and their inner objects as well.

But we have an issue. We have our custom apps written in angularJS and want to use d2 library with it.

As mentioned in the documentation (http://d2.markionium.com), we tried the following.

If you want to use d2 as just a global variable on the window object you can include one of the following scripts in your page d2/lib/d2-browser.js or d2/lib/d2-browser.min.js

But, we are not able to access d2. Is there something we are missing?

Any help here is appreciated.

*Cheers,*


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 2:19 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

I’m working on after finishing a few things for the 2.24 release. Should get you an answer today with some examples. :slight_smile:

Regards,

Mark

On Mon, Jul 4, 2016 at 9:08 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

Could you please provide any information on the above-mentioned queries.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 6:47 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We also came across, d2-analysis library (https://github.com/dhis2/d2-analysis). Is there any documentation about it and how to use it? Can it be used for all the analytics objects (e.g. charts, pivot tables, event charts, event reports)

Regarding the d2 library, could you please let us know its roadmap and what are the features that will be incorporated.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 5:58 PM, Archana Chillala archanac@thoughtworks.com wrote:

Also, could you please share some examples on how to use filters.

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 4:49 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

We want to retrieve data in a format specified as shown below.

http://localhost:8080/api/dataSets.json?fields=name,id,sections[name,dataElements[id,name,valueType]]

which renders this:

  • dataSets:

[

  • {
    • name: “data set”,
- id: "m0rnaeivV6W",
- sections:
  [
  - {
    - name: "Section1",
    - dataElements:
      [
      - {
        - name: "new data element",
        - id: "JyjMOr3En81",
        - valueType: "NUMBER"
        }
      ]
    }
  ]
}

]

Is there any d2 alternative to replicate the same? Or do we have to first get all dataElements and then after getting a dataSet filter from dataElements?

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 7:20 PM, Mark Polak mark@dhis2.org wrote:

Sorry silly me, forgot to include the link :wink:

https://github.com/dhis2/app-skeleton

On Wed, Jun 29, 2016 at 3:28 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Thank you. Could you share a link to the skeleton app you mentioned.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 5:43 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

If you’re still starting to use the tools before that feel free to ask questions on the list or through github issues on the specific repositories and we’ll try to help you as best as we can.

In the mean time you could take a look at our skeleton app. It has a very basic setup of the libraries Nicolay mentioned and a few comments on what is happening :wink:

Regards,

Mark

On Wed, Jun 29, 2016 at 1:22 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thanks a lot, Lars.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 4:25 PM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Archana,

we definitely plan to improve the docs and provide a consistent set of documentation / guides - we just hadn’t had the time yet but its high on our list after 2.24.

regards,

Lars

On Wed, Jun 29, 2016 at 12:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you, Nicolay.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 2:43 PM, Nicolay Ramm nicolay@dhis2.org wrote:

Hi Archana,

unfortunately the documentation that currently exists for D2 is far from extensive. The limited documentation we have can be found here: http://d2.markionium.com

This is generated from the source code, so you’ll find the same documentation in the code itself.

The following apps are written using D2, D2-UI, React and RxJS:

Best regards,

Nicolay Ramm

Front end developer, DHIS 2

University of Oslo

https://www.dhis2.org

On Wed, Jun 29, 2016 at 10:58 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi devs,

We are looking at using d2 library for our custom apps. Could you please direct us to any extensive documentation available for the same. Also, could you please share with us (repo links for) any apps built on react, so we could understand how d2 has been used.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Hi Mark

What is the plan regarding supporting multiple versions of D2js? will it follow DHIS 2 API versions, which means 3 versions always supported? (bugs mostly, but features if not too disruptive)

···

On Thu, Jul 7, 2016 at 7:26 PM, Mark Polak mark@dhis2.org wrote:

Hey Sultan Ahamar,

I’ve fixed the stand alone builds and redeployed to npm.

If you’re developing for dhis 2.23 or lower (or dhis 2.24 with the old importer) use npm install d2@dhis-2.23
If you’re developing for 2.24 with the new importer use npm install d2@dhis-2.24 (To use the new importer you’ve got to set your dhis2 base url to <domain>/api/24

See a simple reference example here https://github.com/Markionium/d2-example-standalone

Let me know if you run into any issues.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Tue, Jul 5, 2016 at 7:43 AM, Sultanahamar Mohammad sultanm@thoughtworks.com wrote:

Hi Mark,

Can we have d2 library without having to depend on webpack, babel and stuff around. A plane js file upon including it, exposes its method on window object may be with a namespace d2. That should make it very easy to people who want to try d2. Right now, people should start understanding webpack, exports and stuff around it.

I think dhis has put effort in doing so with d2-browser.js but its not working as expected. If you can just fix that, it should be very helpful for the community.

Regards,

Sultan Ahamar.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

On Mon, Jul 4, 2016 at 6:41 PM, Mark Polak mark@dhis2.org wrote:

The idea is so simplify the workflow for translators, which means that we’re changing the way the translations are implemented and will likely move from a key based system to a getText style of workflow.

So translations as they currently work are working fine (you can see examples in the other apps too) But in the future we’ll move away from parsing the client side .properties files (yes i know it’s kind of weird … :)). To be more concrete the idea is to have something more like d2.i18n.getTranslation('This is my title') which renders the english text if no translation is available or the language should be english instead of d2.i18n.getTranslation('this_is_my_title') where we need to map the key to English. (There is a long story behind which is not really important, but if you’re interested it is explained in detail in a google doc [1])

For your AngularJS implementation i created a simple example on how such a thing could be achieved. Obviously you would probably not inject d2 into the controller like i’ve done in the example and make it look somewhat cleaner with factories/services that provide the controllers with the data but the idea behind it should be clear :wink:

Hope this helps:
https://github.com/Markionium/d2-angular-webpack

[1] https://docs.google.com/document/d/1u0YhRZD2Q3F8p6VCsz7dXdZxJL45R0qsEfsNc0OCJYs/edit#heading=h.7x8a17q7igji


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Mon, Jul 4, 2016 at 2:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you for the detailed response. Could you elaborate on “Reworking the translation support”.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:53 PM, Mark Polak mark@dhis2.org wrote:

To come back to your earlier questions, which you’ve said you’ve mostly found the answers too :wink:

Loading multiple layers of objects example
https://github.com/Markionium/d2-examples/blob/master/src/deeperModels/index.js

Filtering:
https://github.com/Markionium/d2-examples/blob/master/src/filtering/index.js

Roadmap:

The roadmap for this stuff basically depends on what we need for the stuff we’re currently working on.
What is on the list currently that are major things:

  • fixing PATCH for updates when it is supported in the api.
  • Reworking the translation support
  • Reducing the footprint of the /api/schemas endpoint that gets loaded
  • Batch updates/saves
  • Getting rid of the jQuery dependency

If you find yourself missing something though, you could always contribute or open an issue and we can judge if it is worth adding. :slight_smile:

Further long term, we would like to merge d2 and d2-analysis and implement offline support to a certain degree (to meet the tracker use cases) but both of these are likely not any time soon.

I don’t know much about the d2-analysis and what it supports (there is no documentation yet as far as i’m aware). It can be used with the all the things like charts and maps as thats what we use it for, to power GIS, pivot and friends. Those apps on github must have code that sort of explains how to use it :wink:

Good to know you’re using webpack, that should make it easier :wink: Stay tuned

On Mon, Jul 4, 2016 at 2:19 PM, Archana Chillala archanac@thoughtworks.com wrote:

Yes, we’ll be using webpack.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:14 PM, Mark Polak mark@dhis2.org wrote:

That might be a bit outdated :slight_smile:

Are you using any tools like webpack or babel?

On Mon, Jul 4, 2016 at 1:06 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Sure. Thanks a lot. From the existing apps that are leveraging d2, we have figured out how to use filters and also to retrieve multiple fields and their inner objects as well.

But we have an issue. We have our custom apps written in angularJS and want to use d2 library with it.

As mentioned in the documentation (http://d2.markionium.com), we tried the following.

If you want to use d2 as just a global variable on the window object you can include one of the following scripts in your page d2/lib/d2-browser.js or d2/lib/d2-browser.min.js

But, we are not able to access d2. Is there something we are missing?

Any help here is appreciated.

*Cheers,*


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 2:19 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

I’m working on after finishing a few things for the 2.24 release. Should get you an answer today with some examples. :slight_smile:

Regards,

Mark

On Mon, Jul 4, 2016 at 9:08 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

Could you please provide any information on the above-mentioned queries.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 6:47 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We also came across, d2-analysis library (https://github.com/dhis2/d2-analysis). Is there any documentation about it and how to use it? Can it be used for all the analytics objects (e.g. charts, pivot tables, event charts, event reports)

Regarding the d2 library, could you please let us know its roadmap and what are the features that will be incorporated.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 5:58 PM, Archana Chillala archanac@thoughtworks.com wrote:

Also, could you please share some examples on how to use filters.

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 4:49 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

We want to retrieve data in a format specified as shown below.

http://localhost:8080/api/dataSets.json?fields=name,id,sections[name,dataElements[id,name,valueType]]

which renders this:

  • dataSets:

[

  • {
    • name: “data set”,
- id: "m0rnaeivV6W",
- sections:
  [
  - {
    - name: "Section1",
    - dataElements:
      [
      - {
        - name: "new data element",
        - id: "JyjMOr3En81",
        - valueType: "NUMBER"
        }
      ]
    }
  ]
}

]

Is there any d2 alternative to replicate the same? Or do we have to first get all dataElements and then after getting a dataSet filter from dataElements?

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 7:20 PM, Mark Polak mark@dhis2.org wrote:

Sorry silly me, forgot to include the link :wink:

https://github.com/dhis2/app-skeleton

On Wed, Jun 29, 2016 at 3:28 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Thank you. Could you share a link to the skeleton app you mentioned.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 5:43 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

If you’re still starting to use the tools before that feel free to ask questions on the list or through github issues on the specific repositories and we’ll try to help you as best as we can.

In the mean time you could take a look at our skeleton app. It has a very basic setup of the libraries Nicolay mentioned and a few comments on what is happening :wink:

Regards,

Mark

On Wed, Jun 29, 2016 at 1:22 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thanks a lot, Lars.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 4:25 PM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Archana,

we definitely plan to improve the docs and provide a consistent set of documentation / guides - we just hadn’t had the time yet but its high on our list after 2.24.

regards,

Lars

On Wed, Jun 29, 2016 at 12:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you, Nicolay.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 2:43 PM, Nicolay Ramm nicolay@dhis2.org wrote:

Hi Archana,

unfortunately the documentation that currently exists for D2 is far from extensive. The limited documentation we have can be found here: http://d2.markionium.com

This is generated from the source code, so you’ll find the same documentation in the code itself.

The following apps are written using D2, D2-UI, React and RxJS:

Best regards,

Nicolay Ramm

Front end developer, DHIS 2

University of Oslo

https://www.dhis2.org

On Wed, Jun 29, 2016 at 10:58 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi devs,

We are looking at using d2 library for our custom apps. Could you please direct us to any extensive documentation available for the same. Also, could you please share with us (repo links for) any apps built on react, so we could understand how d2 has been used.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hey Archana,

Please see the answers to your questions below.

  • What is it that d2 offers? What are the benefits over making plain API calls.

    Currently i would say the biggest benefit is readability of your source code and some small abstractions that we do in library over the api. It makes a few things easier, dealing with the currentUser, checking authorities etc. You can always do plain api calls if you think thats easier :wink: We are constantly improving d2, therefore the more work we’ll do the better the benefits get.

  • When d2 library is upgraded or if the API endpoints are changed, how does it affect the d2 models and the apps that use models. Say, we have custom apps, built using d2 version 24 and DHIS2 version 2.24, when we move to DHIS2 version 2.25, how compatible is d2 v24 with the new version of DHIS2? And what are the repercussions that come with it.

    What we’re aiming for is to have d2 v24 always be compatible with /api/24. Therefore when upgrading to dhis 2.25 you have two choices. Update your d2 to v25 (which will be released at the same time as with dhis 2.25, but you can start using it before the release, as we’re developing it incrementally. Your second option would be have your app still use v24 against /api/24 which should still work in dhis 2.25 and likely 2.26. Somewhere by that time you’ll have to have upgraded. (as i think the support schedule for old api versions is 2 versions.)

  • We see a lot of frequent releases on github. Since the model is dynamically built using DHIS schema, what is it that is being added to each release?

    Generally what is added is fixes to the current way of working, improvements and bug fixes. Other fixes for pieces of the api, generally for things that works a bit different than can be determined from the schema. (think, compulsoryDataElementOperands). And obviously new features, like supporting dataStore/userDataStore (which is expected shortly)

  • What is the release cycle of d2 library. If d2 version 25 is released, would it be after DHIS2 release of version 25? How are d2 and DHIS2 releases associated? And how is the relevant d2 library affected.

    Like i mentioned above. d2 v25 will be compatible with dhis2 2.25. v24 with dhis 2.24. (or /api/24, in dhis2 2.25, 2.26) They will be available with/before, their matching dhis2 version.

  • Is it possible to load the models from some other sources (like Indexed DB)

    Not currently from within the library. (There might be in the future, when we’re tying to make the visualisation and tracker/event apps integrated with d2 too) Do you have a use case for this, if so we can discuss how to support this.

  • How flexible is D2 library in handling huge data models? Currently, when we make a call, we get the complete model object. If there is a huge data model, then it might cause performance issues. Is there any way to “not” get the complete model?

    Field filtering is supported, which would only create models with those values, currently there is a limitation that when loading models only partially (using field filtering) calling save() on those models might result in the loss of values for the not loaded properties. (This should be solved when we can implement partial updates using PATCH for all properties, which i think is on the roadmap for 2.25)

  • Do you back-port bug fixes to previous versions of d2? If so, till how many versions backwards?

    **Like Morten suggested, we’ll likely support the last 3 versions. So yes we’ll back-port bug fixes. **

  • What is the bug cycle like? When issues are raised, how soon are the bugs going to be fixed??

    This depends on the severity of the bug :slight_smile: We use d2 in our own applications for the core product, so you can expect it to be well supported.

  • If we go ahead with using d2 library, what is the stable version you might want to suggest?

    Like i mentioned above that depends a bit on what version of dhis2 you’re building for. If you’re building for 2.24, then i’d suggest the /api/24 version of d2 so the d2@24.1.x range on npm.

Hope that answers your questions :slight_smile:

···

On Tue, Jul 5, 2016 at 3:53 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Thanks for your response. Really appreciate it. We would like to understand d2 a little deeper. Could you please answer the following queries:

  • What is it that d2 offers? What are the benefits over making plain API calls.
  • When d2 library is upgraded or if the API endpoints are changed, how does it affect the d2 models and the apps that use models. Say, we have custom apps, built using d2 version 24 and DHIS2 version 2.24, when we move to DHIS2 version 2.25, how compatible is d2 v24 with the new version of DHIS2? And what are the repercussions that come with it.
  • We see a lot of frequent releases on github. Since the model is dynamically built using DHIS schema, what is it that is being added to each release?
  • What is the release cycle of d2 library. If d2 version 25 is released, would it be after DHIS2 release of version 25? How are d2 and DHIS2 releases associated? And how is the relevant d2 library affected.
  • Is it possible to load the models from some other sources (like Indexed DB)
  • How flexible is D2 library in handling huge data models? Currently, when we make a call, we get the complete model object. If there is a huge data model, then it might cause performance issues. Is there any way to “not” get the complete model?
  • Do you back-port bug fixes to previous versions of d2? If so, till how many versions backwards?
  • What is the bug cycle like? When issues are raised, how soon are the bugs going to be fixed??
  • If we go ahead with using d2 library, what is the stable version you might want to suggest?

Thanks,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Tue, Jul 5, 2016 at 12:57 PM, Mark Polak mark@dhis2.org wrote:

To speak in favour of it, it is the “future” way of doing stuff, as it’s basically follows the new standard way of javascript modules (Not webpack obviously, but the ES2016/ES2017 specs).

Anyways, since 2.24 is out i should have some time to look into this. Might take a few days though, so until then you’ll wait. Since we have not maintained that stand alone build for a while, i can not estimate how long it will take me to get it back into shape.

On Tue, Jul 5, 2016 at 7:43 AM, Sultanahamar Mohammad sultanm@thoughtworks.com wrote:

Hi Mark,

Can we have d2 library without having to depend on webpack, babel and stuff around. A plane js file upon including it, exposes its method on window object may be with a namespace d2. That should make it very easy to people who want to try d2. Right now, people should start understanding webpack, exports and stuff around it.

I think dhis has put effort in doing so with d2-browser.js but its not working as expected. If you can just fix that, it should be very helpful for the community.

Regards,

Sultan Ahamar.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

On Mon, Jul 4, 2016 at 6:41 PM, Mark Polak mark@dhis2.org wrote:

The idea is so simplify the workflow for translators, which means that we’re changing the way the translations are implemented and will likely move from a key based system to a getText style of workflow.

So translations as they currently work are working fine (you can see examples in the other apps too) But in the future we’ll move away from parsing the client side .properties files (yes i know it’s kind of weird … :)). To be more concrete the idea is to have something more like d2.i18n.getTranslation('This is my title') which renders the english text if no translation is available or the language should be english instead of d2.i18n.getTranslation('this_is_my_title') where we need to map the key to English. (There is a long story behind which is not really important, but if you’re interested it is explained in detail in a google doc [1])

For your AngularJS implementation i created a simple example on how such a thing could be achieved. Obviously you would probably not inject d2 into the controller like i’ve done in the example and make it look somewhat cleaner with factories/services that provide the controllers with the data but the idea behind it should be clear :wink:

Hope this helps:
https://github.com/Markionium/d2-angular-webpack

[1] https://docs.google.com/document/d/1u0YhRZD2Q3F8p6VCsz7dXdZxJL45R0qsEfsNc0OCJYs/edit#heading=h.7x8a17q7igji


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Mon, Jul 4, 2016 at 2:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you for the detailed response. Could you elaborate on “Reworking the translation support”.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:53 PM, Mark Polak mark@dhis2.org wrote:

To come back to your earlier questions, which you’ve said you’ve mostly found the answers too :wink:

Loading multiple layers of objects example
https://github.com/Markionium/d2-examples/blob/master/src/deeperModels/index.js

Filtering:
https://github.com/Markionium/d2-examples/blob/master/src/filtering/index.js

Roadmap:

The roadmap for this stuff basically depends on what we need for the stuff we’re currently working on.
What is on the list currently that are major things:

  • fixing PATCH for updates when it is supported in the api.
  • Reworking the translation support
  • Reducing the footprint of the /api/schemas endpoint that gets loaded
  • Batch updates/saves
  • Getting rid of the jQuery dependency

If you find yourself missing something though, you could always contribute or open an issue and we can judge if it is worth adding. :slight_smile:

Further long term, we would like to merge d2 and d2-analysis and implement offline support to a certain degree (to meet the tracker use cases) but both of these are likely not any time soon.

I don’t know much about the d2-analysis and what it supports (there is no documentation yet as far as i’m aware). It can be used with the all the things like charts and maps as thats what we use it for, to power GIS, pivot and friends. Those apps on github must have code that sort of explains how to use it :wink:

Good to know you’re using webpack, that should make it easier :wink: Stay tuned

On Mon, Jul 4, 2016 at 2:19 PM, Archana Chillala archanac@thoughtworks.com wrote:

Yes, we’ll be using webpack.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:14 PM, Mark Polak mark@dhis2.org wrote:

That might be a bit outdated :slight_smile:

Are you using any tools like webpack or babel?

On Mon, Jul 4, 2016 at 1:06 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Sure. Thanks a lot. From the existing apps that are leveraging d2, we have figured out how to use filters and also to retrieve multiple fields and their inner objects as well.

But we have an issue. We have our custom apps written in angularJS and want to use d2 library with it.

As mentioned in the documentation (http://d2.markionium.com), we tried the following.

If you want to use d2 as just a global variable on the window object you can include one of the following scripts in your page d2/lib/d2-browser.js or d2/lib/d2-browser.min.js

But, we are not able to access d2. Is there something we are missing?

Any help here is appreciated.

*Cheers,*


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 2:19 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

I’m working on after finishing a few things for the 2.24 release. Should get you an answer today with some examples. :slight_smile:

Regards,

Mark

On Mon, Jul 4, 2016 at 9:08 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

Could you please provide any information on the above-mentioned queries.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 6:47 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We also came across, d2-analysis library (https://github.com/dhis2/d2-analysis). Is there any documentation about it and how to use it? Can it be used for all the analytics objects (e.g. charts, pivot tables, event charts, event reports)

Regarding the d2 library, could you please let us know its roadmap and what are the features that will be incorporated.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 5:58 PM, Archana Chillala archanac@thoughtworks.com wrote:

Also, could you please share some examples on how to use filters.

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 4:49 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

We want to retrieve data in a format specified as shown below.

http://localhost:8080/api/dataSets.json?fields=name,id,sections[name,dataElements[id,name,valueType]]

which renders this:

  • dataSets:

[

  • {
    • name: “data set”,
- id: "m0rnaeivV6W",
- sections:
  [
  - {
    - name: "Section1",
    - dataElements:
      [
      - {
        - name: "new data element",
        - id: "JyjMOr3En81",
        - valueType: "NUMBER"
        }
      ]
    }
  ]
}

]

Is there any d2 alternative to replicate the same? Or do we have to first get all dataElements and then after getting a dataSet filter from dataElements?

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 7:20 PM, Mark Polak mark@dhis2.org wrote:

Sorry silly me, forgot to include the link :wink:

https://github.com/dhis2/app-skeleton

On Wed, Jun 29, 2016 at 3:28 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Thank you. Could you share a link to the skeleton app you mentioned.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 5:43 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

If you’re still starting to use the tools before that feel free to ask questions on the list or through github issues on the specific repositories and we’ll try to help you as best as we can.

In the mean time you could take a look at our skeleton app. It has a very basic setup of the libraries Nicolay mentioned and a few comments on what is happening :wink:

Regards,

Mark

On Wed, Jun 29, 2016 at 1:22 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thanks a lot, Lars.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 4:25 PM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Archana,

we definitely plan to improve the docs and provide a consistent set of documentation / guides - we just hadn’t had the time yet but its high on our list after 2.24.

regards,

Lars

On Wed, Jun 29, 2016 at 12:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you, Nicolay.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 2:43 PM, Nicolay Ramm nicolay@dhis2.org wrote:

Hi Archana,

unfortunately the documentation that currently exists for D2 is far from extensive. The limited documentation we have can be found here: http://d2.markionium.com

This is generated from the source code, so you’ll find the same documentation in the code itself.

The following apps are written using D2, D2-UI, React and RxJS:

Best regards,

Nicolay Ramm

Front end developer, DHIS 2

University of Oslo

https://www.dhis2.org

On Wed, Jun 29, 2016 at 10:58 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi devs,

We are looking at using d2 library for our custom apps. Could you please direct us to any extensive documentation available for the same. Also, could you please share with us (repo links for) any apps built on react, so we could understand how d2 has been used.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Hi Mark,

Thanks a lot for the detailed response. That was really helpful.

Cheers,

···

On Thu, Jul 7, 2016 at 6:26 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

Please see the answers to your questions below.

  • What is it that d2 offers? What are the benefits over making plain API calls.

    Currently i would say the biggest benefit is readability of your source code and some small abstractions that we do in library over the api. It makes a few things easier, dealing with the currentUser, checking authorities etc. You can always do plain api calls if you think thats easier :wink: We are constantly improving d2, therefore the more work we’ll do the better the benefits get.

  • When d2 library is upgraded or if the API endpoints are changed, how does it affect the d2 models and the apps that use models. Say, we have custom apps, built using d2 version 24 and DHIS2 version 2.24, when we move to DHIS2 version 2.25, how compatible is d2 v24 with the new version of DHIS2? And what are the repercussions that come with it.

    What we’re aiming for is to have d2 v24 always be compatible with /api/24. Therefore when upgrading to dhis 2.25 you have two choices. Update your d2 to v25 (which will be released at the same time as with dhis 2.25, but you can start using it before the release, as we’re developing it incrementally. Your second option would be have your app still use v24 against /api/24 which should still work in dhis 2.25 and likely 2.26. Somewhere by that time you’ll have to have upgraded. (as i think the support schedule for old api versions is 2 versions.)

  • We see a lot of frequent releases on github. Since the model is dynamically built using DHIS schema, what is it that is being added to each release?

    Generally what is added is fixes to the current way of working, improvements and bug fixes. Other fixes for pieces of the api, generally for things that works a bit different than can be determined from the schema. (think, compulsoryDataElementOperands). And obviously new features, like supporting dataStore/userDataStore (which is expected shortly)

  • What is the release cycle of d2 library. If d2 version 25 is released, would it be after DHIS2 release of version 25? How are d2 and DHIS2 releases associated? And how is the relevant d2 library affected.

    Like i mentioned above. d2 v25 will be compatible with dhis2 2.25. v24 with dhis 2.24. (or /api/24, in dhis2 2.25, 2.26) They will be available with/before, their matching dhis2 version.

  • Is it possible to load the models from some other sources (like Indexed DB)

    Not currently from within the library. (There might be in the future, when we’re tying to make the visualisation and tracker/event apps integrated with d2 too) Do you have a use case for this, if so we can discuss how to support this.

  • How flexible is D2 library in handling huge data models? Currently, when we make a call, we get the complete model object. If there is a huge data model, then it might cause performance issues. Is there any way to “not” get the complete model?

    Field filtering is supported, which would only create models with those values, currently there is a limitation that when loading models only partially (using field filtering) calling save() on those models might result in the loss of values for the not loaded properties. (This should be solved when we can implement partial updates using PATCH for all properties, which i think is on the roadmap for 2.25)

  • Do you back-port bug fixes to previous versions of d2? If so, till how many versions backwards?

    **Like Morten suggested, we’ll likely support the last 3 versions. So yes we’ll back-port bug fixes. **

  • What is the bug cycle like? When issues are raised, how soon are the bugs going to be fixed??

    This depends on the severity of the bug :slight_smile: We use d2 in our own applications for the core product, so you can expect it to be well supported.

  • If we go ahead with using d2 library, what is the stable version you might want to suggest?

    Like i mentioned above that depends a bit on what version of dhis2 you’re building for. If you’re building for 2.24, then i’d suggest the /api/24 version of d2 so the d2@24.1.x range on npm.

Hope that answers your questions :slight_smile:

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Tue, Jul 5, 2016 at 3:53 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Thanks for your response. Really appreciate it. We would like to understand d2 a little deeper. Could you please answer the following queries:

  • What is it that d2 offers? What are the benefits over making plain API calls.
  • When d2 library is upgraded or if the API endpoints are changed, how does it affect the d2 models and the apps that use models. Say, we have custom apps, built using d2 version 24 and DHIS2 version 2.24, when we move to DHIS2 version 2.25, how compatible is d2 v24 with the new version of DHIS2? And what are the repercussions that come with it.
  • We see a lot of frequent releases on github. Since the model is dynamically built using DHIS schema, what is it that is being added to each release?
  • What is the release cycle of d2 library. If d2 version 25 is released, would it be after DHIS2 release of version 25? How are d2 and DHIS2 releases associated? And how is the relevant d2 library affected.
  • Is it possible to load the models from some other sources (like Indexed DB)
  • How flexible is D2 library in handling huge data models? Currently, when we make a call, we get the complete model object. If there is a huge data model, then it might cause performance issues. Is there any way to “not” get the complete model?
  • Do you back-port bug fixes to previous versions of d2? If so, till how many versions backwards?
  • What is the bug cycle like? When issues are raised, how soon are the bugs going to be fixed??
  • If we go ahead with using d2 library, what is the stable version you might want to suggest?

Thanks,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Tue, Jul 5, 2016 at 12:57 PM, Mark Polak mark@dhis2.org wrote:

To speak in favour of it, it is the “future” way of doing stuff, as it’s basically follows the new standard way of javascript modules (Not webpack obviously, but the ES2016/ES2017 specs).

Anyways, since 2.24 is out i should have some time to look into this. Might take a few days though, so until then you’ll wait. Since we have not maintained that stand alone build for a while, i can not estimate how long it will take me to get it back into shape.

On Tue, Jul 5, 2016 at 7:43 AM, Sultanahamar Mohammad sultanm@thoughtworks.com wrote:

Hi Mark,

Can we have d2 library without having to depend on webpack, babel and stuff around. A plane js file upon including it, exposes its method on window object may be with a namespace d2. That should make it very easy to people who want to try d2. Right now, people should start understanding webpack, exports and stuff around it.

I think dhis has put effort in doing so with d2-browser.js but its not working as expected. If you can just fix that, it should be very helpful for the community.

Regards,

Sultan Ahamar.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

On Mon, Jul 4, 2016 at 6:41 PM, Mark Polak mark@dhis2.org wrote:

The idea is so simplify the workflow for translators, which means that we’re changing the way the translations are implemented and will likely move from a key based system to a getText style of workflow.

So translations as they currently work are working fine (you can see examples in the other apps too) But in the future we’ll move away from parsing the client side .properties files (yes i know it’s kind of weird … :)). To be more concrete the idea is to have something more like d2.i18n.getTranslation('This is my title') which renders the english text if no translation is available or the language should be english instead of d2.i18n.getTranslation('this_is_my_title') where we need to map the key to English. (There is a long story behind which is not really important, but if you’re interested it is explained in detail in a google doc [1])

For your AngularJS implementation i created a simple example on how such a thing could be achieved. Obviously you would probably not inject d2 into the controller like i’ve done in the example and make it look somewhat cleaner with factories/services that provide the controllers with the data but the idea behind it should be clear :wink:

Hope this helps:
https://github.com/Markionium/d2-angular-webpack

[1] https://docs.google.com/document/d/1u0YhRZD2Q3F8p6VCsz7dXdZxJL45R0qsEfsNc0OCJYs/edit#heading=h.7x8a17q7igji


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Mon, Jul 4, 2016 at 2:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you for the detailed response. Could you elaborate on “Reworking the translation support”.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:53 PM, Mark Polak mark@dhis2.org wrote:

To come back to your earlier questions, which you’ve said you’ve mostly found the answers too :wink:

Loading multiple layers of objects example
https://github.com/Markionium/d2-examples/blob/master/src/deeperModels/index.js

Filtering:
https://github.com/Markionium/d2-examples/blob/master/src/filtering/index.js

Roadmap:

The roadmap for this stuff basically depends on what we need for the stuff we’re currently working on.
What is on the list currently that are major things:

  • fixing PATCH for updates when it is supported in the api.
  • Reworking the translation support
  • Reducing the footprint of the /api/schemas endpoint that gets loaded
  • Batch updates/saves
  • Getting rid of the jQuery dependency

If you find yourself missing something though, you could always contribute or open an issue and we can judge if it is worth adding. :slight_smile:

Further long term, we would like to merge d2 and d2-analysis and implement offline support to a certain degree (to meet the tracker use cases) but both of these are likely not any time soon.

I don’t know much about the d2-analysis and what it supports (there is no documentation yet as far as i’m aware). It can be used with the all the things like charts and maps as thats what we use it for, to power GIS, pivot and friends. Those apps on github must have code that sort of explains how to use it :wink:

Good to know you’re using webpack, that should make it easier :wink: Stay tuned

On Mon, Jul 4, 2016 at 2:19 PM, Archana Chillala archanac@thoughtworks.com wrote:

Yes, we’ll be using webpack.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:14 PM, Mark Polak mark@dhis2.org wrote:

That might be a bit outdated :slight_smile:

Are you using any tools like webpack or babel?

On Mon, Jul 4, 2016 at 1:06 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Sure. Thanks a lot. From the existing apps that are leveraging d2, we have figured out how to use filters and also to retrieve multiple fields and their inner objects as well.

But we have an issue. We have our custom apps written in angularJS and want to use d2 library with it.

As mentioned in the documentation (http://d2.markionium.com), we tried the following.

If you want to use d2 as just a global variable on the window object you can include one of the following scripts in your page d2/lib/d2-browser.js or d2/lib/d2-browser.min.js

But, we are not able to access d2. Is there something we are missing?

Any help here is appreciated.

*Cheers,*


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 2:19 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

I’m working on after finishing a few things for the 2.24 release. Should get you an answer today with some examples. :slight_smile:

Regards,

Mark

On Mon, Jul 4, 2016 at 9:08 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

Could you please provide any information on the above-mentioned queries.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 6:47 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We also came across, d2-analysis library (https://github.com/dhis2/d2-analysis). Is there any documentation about it and how to use it? Can it be used for all the analytics objects (e.g. charts, pivot tables, event charts, event reports)

Regarding the d2 library, could you please let us know its roadmap and what are the features that will be incorporated.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 5:58 PM, Archana Chillala archanac@thoughtworks.com wrote:

Also, could you please share some examples on how to use filters.

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 4:49 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

We want to retrieve data in a format specified as shown below.

http://localhost:8080/api/dataSets.json?fields=name,id,sections[name,dataElements[id,name,valueType]]

which renders this:

  • dataSets:

[

  • {
    • name: “data set”,
- id: "m0rnaeivV6W",
- sections:
  [
  - {
    - name: "Section1",
    - dataElements:
      [
      - {
        - name: "new data element",
        - id: "JyjMOr3En81",
        - valueType: "NUMBER"
        }
      ]
    }
  ]
}

]

Is there any d2 alternative to replicate the same? Or do we have to first get all dataElements and then after getting a dataSet filter from dataElements?

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 7:20 PM, Mark Polak mark@dhis2.org wrote:

Sorry silly me, forgot to include the link :wink:

https://github.com/dhis2/app-skeleton

On Wed, Jun 29, 2016 at 3:28 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Thank you. Could you share a link to the skeleton app you mentioned.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 5:43 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

If you’re still starting to use the tools before that feel free to ask questions on the list or through github issues on the specific repositories and we’ll try to help you as best as we can.

In the mean time you could take a look at our skeleton app. It has a very basic setup of the libraries Nicolay mentioned and a few comments on what is happening :wink:

Regards,

Mark

On Wed, Jun 29, 2016 at 1:22 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thanks a lot, Lars.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 4:25 PM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Archana,

we definitely plan to improve the docs and provide a consistent set of documentation / guides - we just hadn’t had the time yet but its high on our list after 2.24.

regards,

Lars

On Wed, Jun 29, 2016 at 12:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you, Nicolay.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 2:43 PM, Nicolay Ramm nicolay@dhis2.org wrote:

Hi Archana,

unfortunately the documentation that currently exists for D2 is far from extensive. The limited documentation we have can be found here: http://d2.markionium.com

This is generated from the source code, so you’ll find the same documentation in the code itself.

The following apps are written using D2, D2-UI, React and RxJS:

Best regards,

Nicolay Ramm

Front end developer, DHIS 2

University of Oslo

https://www.dhis2.org

On Wed, Jun 29, 2016 at 10:58 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi devs,

We are looking at using d2 library for our custom apps. Could you please direct us to any extensive documentation available for the same. Also, could you please share with us (repo links for) any apps built on react, so we could understand how d2 has been used.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hey Archana,

Let me know if you have any other questions :slight_smile:

···

On Thu, Jul 7, 2016 at 9:24 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Thanks a lot for the detailed response. That was really helpful.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jul 7, 2016 at 6:26 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

Please see the answers to your questions below.

  • What is it that d2 offers? What are the benefits over making plain API calls.

    Currently i would say the biggest benefit is readability of your source code and some small abstractions that we do in library over the api. It makes a few things easier, dealing with the currentUser, checking authorities etc. You can always do plain api calls if you think thats easier :wink: We are constantly improving d2, therefore the more work we’ll do the better the benefits get.

  • When d2 library is upgraded or if the API endpoints are changed, how does it affect the d2 models and the apps that use models. Say, we have custom apps, built using d2 version 24 and DHIS2 version 2.24, when we move to DHIS2 version 2.25, how compatible is d2 v24 with the new version of DHIS2? And what are the repercussions that come with it.

    What we’re aiming for is to have d2 v24 always be compatible with /api/24. Therefore when upgrading to dhis 2.25 you have two choices. Update your d2 to v25 (which will be released at the same time as with dhis 2.25, but you can start using it before the release, as we’re developing it incrementally. Your second option would be have your app still use v24 against /api/24 which should still work in dhis 2.25 and likely 2.26. Somewhere by that time you’ll have to have upgraded. (as i think the support schedule for old api versions is 2 versions.)

  • We see a lot of frequent releases on github. Since the model is dynamically built using DHIS schema, what is it that is being added to each release?

    Generally what is added is fixes to the current way of working, improvements and bug fixes. Other fixes for pieces of the api, generally for things that works a bit different than can be determined from the schema. (think, compulsoryDataElementOperands). And obviously new features, like supporting dataStore/userDataStore (which is expected shortly)

  • What is the release cycle of d2 library. If d2 version 25 is released, would it be after DHIS2 release of version 25? How are d2 and DHIS2 releases associated? And how is the relevant d2 library affected.

    Like i mentioned above. d2 v25 will be compatible with dhis2 2.25. v24 with dhis 2.24. (or /api/24, in dhis2 2.25, 2.26) They will be available with/before, their matching dhis2 version.

  • Is it possible to load the models from some other sources (like Indexed DB)

    Not currently from within the library. (There might be in the future, when we’re tying to make the visualisation and tracker/event apps integrated with d2 too) Do you have a use case for this, if so we can discuss how to support this.

  • How flexible is D2 library in handling huge data models? Currently, when we make a call, we get the complete model object. If there is a huge data model, then it might cause performance issues. Is there any way to “not” get the complete model?

    Field filtering is supported, which would only create models with those values, currently there is a limitation that when loading models only partially (using field filtering) calling save() on those models might result in the loss of values for the not loaded properties. (This should be solved when we can implement partial updates using PATCH for all properties, which i think is on the roadmap for 2.25)

  • Do you back-port bug fixes to previous versions of d2? If so, till how many versions backwards?

    **Like Morten suggested, we’ll likely support the last 3 versions. So yes we’ll back-port bug fixes. **

  • What is the bug cycle like? When issues are raised, how soon are the bugs going to be fixed??

    This depends on the severity of the bug :slight_smile: We use d2 in our own applications for the core product, so you can expect it to be well supported.

  • If we go ahead with using d2 library, what is the stable version you might want to suggest?

    Like i mentioned above that depends a bit on what version of dhis2 you’re building for. If you’re building for 2.24, then i’d suggest the /api/24 version of d2 so the d2@24.1.x range on npm.

Hope that answers your questions :slight_smile:

On Tue, Jul 5, 2016 at 3:53 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Thanks for your response. Really appreciate it. We would like to understand d2 a little deeper. Could you please answer the following queries:

  • What is it that d2 offers? What are the benefits over making plain API calls.
  • When d2 library is upgraded or if the API endpoints are changed, how does it affect the d2 models and the apps that use models. Say, we have custom apps, built using d2 version 24 and DHIS2 version 2.24, when we move to DHIS2 version 2.25, how compatible is d2 v24 with the new version of DHIS2? And what are the repercussions that come with it.
  • We see a lot of frequent releases on github. Since the model is dynamically built using DHIS schema, what is it that is being added to each release?
  • What is the release cycle of d2 library. If d2 version 25 is released, would it be after DHIS2 release of version 25? How are d2 and DHIS2 releases associated? And how is the relevant d2 library affected.
  • Is it possible to load the models from some other sources (like Indexed DB)
  • How flexible is D2 library in handling huge data models? Currently, when we make a call, we get the complete model object. If there is a huge data model, then it might cause performance issues. Is there any way to “not” get the complete model?
  • Do you back-port bug fixes to previous versions of d2? If so, till how many versions backwards?
  • What is the bug cycle like? When issues are raised, how soon are the bugs going to be fixed??
  • If we go ahead with using d2 library, what is the stable version you might want to suggest?

Thanks,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Tue, Jul 5, 2016 at 12:57 PM, Mark Polak mark@dhis2.org wrote:

To speak in favour of it, it is the “future” way of doing stuff, as it’s basically follows the new standard way of javascript modules (Not webpack obviously, but the ES2016/ES2017 specs).

Anyways, since 2.24 is out i should have some time to look into this. Might take a few days though, so until then you’ll wait. Since we have not maintained that stand alone build for a while, i can not estimate how long it will take me to get it back into shape.

On Tue, Jul 5, 2016 at 7:43 AM, Sultanahamar Mohammad sultanm@thoughtworks.com wrote:

Hi Mark,

Can we have d2 library without having to depend on webpack, babel and stuff around. A plane js file upon including it, exposes its method on window object may be with a namespace d2. That should make it very easy to people who want to try d2. Right now, people should start understanding webpack, exports and stuff around it.

I think dhis has put effort in doing so with d2-browser.js but its not working as expected. If you can just fix that, it should be very helpful for the community.

Regards,

Sultan Ahamar.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

On Mon, Jul 4, 2016 at 6:41 PM, Mark Polak mark@dhis2.org wrote:

The idea is so simplify the workflow for translators, which means that we’re changing the way the translations are implemented and will likely move from a key based system to a getText style of workflow.

So translations as they currently work are working fine (you can see examples in the other apps too) But in the future we’ll move away from parsing the client side .properties files (yes i know it’s kind of weird … :)). To be more concrete the idea is to have something more like d2.i18n.getTranslation('This is my title') which renders the english text if no translation is available or the language should be english instead of d2.i18n.getTranslation('this_is_my_title') where we need to map the key to English. (There is a long story behind which is not really important, but if you’re interested it is explained in detail in a google doc [1])

For your AngularJS implementation i created a simple example on how such a thing could be achieved. Obviously you would probably not inject d2 into the controller like i’ve done in the example and make it look somewhat cleaner with factories/services that provide the controllers with the data but the idea behind it should be clear :wink:

Hope this helps:
https://github.com/Markionium/d2-angular-webpack

[1] https://docs.google.com/document/d/1u0YhRZD2Q3F8p6VCsz7dXdZxJL45R0qsEfsNc0OCJYs/edit#heading=h.7x8a17q7igji


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

On Mon, Jul 4, 2016 at 2:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you for the detailed response. Could you elaborate on “Reworking the translation support”.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:53 PM, Mark Polak mark@dhis2.org wrote:

To come back to your earlier questions, which you’ve said you’ve mostly found the answers too :wink:

Loading multiple layers of objects example
https://github.com/Markionium/d2-examples/blob/master/src/deeperModels/index.js

Filtering:
https://github.com/Markionium/d2-examples/blob/master/src/filtering/index.js

Roadmap:

The roadmap for this stuff basically depends on what we need for the stuff we’re currently working on.
What is on the list currently that are major things:

  • fixing PATCH for updates when it is supported in the api.
  • Reworking the translation support
  • Reducing the footprint of the /api/schemas endpoint that gets loaded
  • Batch updates/saves
  • Getting rid of the jQuery dependency

If you find yourself missing something though, you could always contribute or open an issue and we can judge if it is worth adding. :slight_smile:

Further long term, we would like to merge d2 and d2-analysis and implement offline support to a certain degree (to meet the tracker use cases) but both of these are likely not any time soon.

I don’t know much about the d2-analysis and what it supports (there is no documentation yet as far as i’m aware). It can be used with the all the things like charts and maps as thats what we use it for, to power GIS, pivot and friends. Those apps on github must have code that sort of explains how to use it :wink:

Good to know you’re using webpack, that should make it easier :wink: Stay tuned

On Mon, Jul 4, 2016 at 2:19 PM, Archana Chillala archanac@thoughtworks.com wrote:

Yes, we’ll be using webpack.


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 5:14 PM, Mark Polak mark@dhis2.org wrote:

That might be a bit outdated :slight_smile:

Are you using any tools like webpack or babel?

On Mon, Jul 4, 2016 at 1:06 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Sure. Thanks a lot. From the existing apps that are leveraging d2, we have figured out how to use filters and also to retrieve multiple fields and their inner objects as well.

But we have an issue. We have our custom apps written in angularJS and want to use d2 library with it.

As mentioned in the documentation (http://d2.markionium.com), we tried the following.

If you want to use d2 as just a global variable on the window object you can include one of the following scripts in your page d2/lib/d2-browser.js or d2/lib/d2-browser.min.js

But, we are not able to access d2. Is there something we are missing?

Any help here is appreciated.

*Cheers,*


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Mon, Jul 4, 2016 at 2:19 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

I’m working on after finishing a few things for the 2.24 release. Should get you an answer today with some examples. :slight_smile:

Regards,

Mark

On Mon, Jul 4, 2016 at 9:08 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

Could you please provide any information on the above-mentioned queries.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 6:47 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi,

We also came across, d2-analysis library (https://github.com/dhis2/d2-analysis). Is there any documentation about it and how to use it? Can it be used for all the analytics objects (e.g. charts, pivot tables, event charts, event reports)

Regarding the d2 library, could you please let us know its roadmap and what are the features that will be incorporated.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 5:58 PM, Archana Chillala archanac@thoughtworks.com wrote:

Also, could you please share some examples on how to use filters.

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Thu, Jun 30, 2016 at 4:49 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

We want to retrieve data in a format specified as shown below.

http://localhost:8080/api/dataSets.json?fields=name,id,sections[name,dataElements[id,name,valueType]]

which renders this:

  • dataSets:

[

  • {
    • name: “data set”,
- id: "m0rnaeivV6W",
- sections:
  [
  - {
    - name: "Section1",
    - dataElements:
      [
      - {
        - name: "new data element",
        - id: "JyjMOr3En81",
        - valueType: "NUMBER"
        }
      ]
    }
  ]
}

]

Is there any d2 alternative to replicate the same? Or do we have to first get all dataElements and then after getting a dataSet filter from dataElements?

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 7:20 PM, Mark Polak mark@dhis2.org wrote:

Sorry silly me, forgot to include the link :wink:

https://github.com/dhis2/app-skeleton

On Wed, Jun 29, 2016 at 3:28 PM, Archana Chillala archanac@thoughtworks.com wrote:

Hi Mark,

Thank you. Could you share a link to the skeleton app you mentioned.

Cheers,


Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 5:43 PM, Mark Polak mark@dhis2.org wrote:

Hey Archana,

If you’re still starting to use the tools before that feel free to ask questions on the list or through github issues on the specific repositories and we’ll try to help you as best as we can.

In the mean time you could take a look at our skeleton app. It has a very basic setup of the libraries Nicolay mentioned and a few comments on what is happening :wink:

Regards,

Mark

On Wed, Jun 29, 2016 at 1:22 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thanks a lot, Lars.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 4:25 PM, Lars Helge Øverland lars@dhis2.org wrote:

Hi Archana,

we definitely plan to improve the docs and provide a consistent set of documentation / guides - we just hadn’t had the time yet but its high on our list after 2.24.

regards,

Lars

On Wed, Jun 29, 2016 at 12:44 PM, Archana Chillala archanac@thoughtworks.com wrote:

Thank you, Nicolay.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Lars Helge Øverland

Lead developer, DHIS 2

University of Oslo

Skype: larshelgeoverland

lars@dhis2.org

http://www.dhis2.org

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks

On Wed, Jun 29, 2016 at 2:43 PM, Nicolay Ramm nicolay@dhis2.org wrote:

Hi Archana,

unfortunately the documentation that currently exists for D2 is far from extensive. The limited documentation we have can be found here: http://d2.markionium.com

This is generated from the source code, so you’ll find the same documentation in the code itself.

The following apps are written using D2, D2-UI, React and RxJS:

Best regards,

Nicolay Ramm

Front end developer, DHIS 2

University of Oslo

https://www.dhis2.org

On Wed, Jun 29, 2016 at 10:58 AM, Archana Chillala archanac@thoughtworks.com wrote:

Hi devs,

We are looking at using d2 library for our custom apps. Could you please direct us to any extensive documentation available for the same. Also, could you please share with us (repo links for) any apps built on react, so we could understand how d2 has been used.

Thank you.

Cheers,

Archana Chillala
Application Developer
Email
archanac@thoughtworks.com
Telephone
+91 9100960533
ThoughtWorks


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Regards,

Mark Polak

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

mark@dhis2.org

how do i install the d2-ui

Hi @mutesasira.

Are you aware of these online docs:

Hi @jaime.bosque I tried to install the D2 CLI on my ubuntu 20.04 machine using the command “yarn global add @dhis2/cli”, however after successful installation, when I try to use it, It gives me a command not found, am I missing something?

Hey @mutesasira,
How did you install yarn? Please check if the folder you get from the (yarn global bin) is in the PATH. If it is, how about trying to use sudo for this command and see if it works? My other suggestion if none of this works, why don’t you try to use npx @dhis2/cli instead?

Actually, you can ignore completely what I said and review the developers guide to installing d2 cli DHIS2 Docker - Install d2 cli | DHIS2 Developers Portal :+1::+1:

Hey @Gassim thank you for this feedback, let me work and revert back to you

1 Like