The D3Map Region Views module extends the feature of D3Map views module.

This module helps to highlight specific regions and makes each region clickable to filter the content to specific region.

We can also highlight regions by extending feature of highlighting states from D3Map views module.

Existing display "D3 Map" is being reused to change states to regions based.

More Technical Notes:

  • The module uses existing view display "D3 Map" that can be used to render the content of a view
  • The map display uses json file of states present in d3map views module.
  • Custom territories are added to map for their representation as well as smaller state areas on the east coast (D3 manipulation)
  • This is intended to be added to a page which contains the desired view of the content and has a region field which uses "region" as the URL variable representing the region to filter the content accordingly.
  • Clicking a region generates a "page click" that changes the "region" value in the URL to the desired region representation value of the selected state

Dependencies

D3 Map Views module is required since this module is the extension of it.

D3 Library is also required which includes one of the versions of D3.js

Please refer readme.txt for installation and configuration.

Please find the below git clone command to check the module.

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/ganesangopal/2606188.git d3map_region_views

Sandbox page: https://www.drupal.org/sandbox/ganesangopal/2606188

Pareview
http://pareview.sh/pareview/httpgitdrupalorgsandboxganesangopal2606188git

Manual Reviews of other projects
https://www.drupal.org/node/2756909#comment-11634881

https://www.drupal.org/node/2795715#comment-11635835
https://www.drupal.org/node/2767049#comment-11655259
https://www.drupal.org/node/2796315#comment-11681203
https://www.drupal.org/node/2795951#comment-11729077
https://www.drupal.org/node/2792763#comment-11729785
https://www.drupal.org/node/2796389#comment-11729943

CommentFileSizeAuthor
d3map_region.png93.33 KBganesan g
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ganesan gopal created an issue. See original summary.

ganesan g’s picture

Issue summary: View changes
ganesan g’s picture

Issue summary: View changes
PA robot’s picture

Status: Active » Needs work

Git clone command for the sandbox is missing in the issue summary, please add it.

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

ganesan g’s picture

Issue summary: View changes
ganesan g’s picture

Issue summary: View changes
ganesan g’s picture

Status: Needs work » Needs review
PA robot’s picture

Issue summary: View changes
Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxganesangopal2606188git

Fixed the git clone URL in the issue summary for non-maintainer users.

I'm a robot and this is an automated message from Project Applications Scraper.

ganesan g’s picture

Issue summary: View changes
ganesan g’s picture

Status: Needs work » Needs review

I have resolved the errors reported by automated review tools except the error "d3 is not defined".

That error cannot be resolved since d3 variable is defined in external library file "d3.js". That library is compulsory for D3Map Views module which is the dependency for this module.

So d3 variable will be defined when D3Map region views module's js file uses it. Please check it.

ganesan g’s picture

Title: D3Map Region Views » [D7] D3Map Region Views
Issue summary: View changes

Added D7

ganesan g’s picture

Issue summary: View changes
Issue tags: -views +PAreview: review bonus
ganesan g’s picture

Issue summary: View changes
jack_ry’s picture

Hi Ganesan Gopal,

Could you specify the version of d3 js that is applicable for your project. When I tried with the latest version I get a console error and could not find the map.

ganesan g’s picture

Hi jack_ry,
I updated the version info in readme.txt. Version should be lesser than 4.0.0. Please review.

ganesan g’s picture

Issue summary: View changes
klausi’s picture

Issue summary: View changes
klausi’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

manual review:

  1. The Git commits are not connected to your user account. You need to specify an email address. See https://www.drupal.org/node/1022156 and https://www.drupal.org/node/1051722
  2. "drupal_alter('d3map_views_alter_shape_data', $result, $shape);": Hooks that are provided by a module should be documented in MODULENAME.api.php, see http://drupal.org/node/161085#api_php
  3. d3map_region_views_plugin_style: don't use drupal_add_js() here, you can also add your JS settings to #attached.
  4. d3map_region_views_plugin_style: do not call theme here, just build the render array. Drupal will render it later for you. Instead of #markup you can use #theme, see https://www.drupal.org/node/930760
  5. d3map.js: the state and territory labels should probably run through Drupal.t() for translation?

Otherwise looks good to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

ganesan g’s picture

@klausi, Thanks for the review. I added all of the recommendations which you suggested except 5th point.

In this map, we are showing only postal codes. State/territory labels are used just for readability to show which postal code belongs to which state. In dependency module "D3Map Views" also using the same. So translation is not needed for state and territory labels.

Will review 3 more project and add review bonus tag.

ganesan g’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus
klausi’s picture

Status: Reviewed & tested by the community » Fixed

No objection for a week, so ...

Thanks for your contribution, Ganesan!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

ganesan g’s picture

Thanks for all the reviewers who reviewed my project. I had learned a lot through this process.

Thank you klausi.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.