Skip to content

Clean the "update" event signature #105

@Indigo744

Description

@Indigo744

This is a ticket to talk about the event signature.

In #85, you said you wanted to clean this signature. I agree it became quite complicated and an overhaul would be good.
Before:

$(".container").trigger('update', [updatedOptions, newPlots, deletedPlots, opt]);

After:

var options = {
  'mapOptions' : {}, // was updatedOptions
  'replace' : true/false // whether mapsOptions should entirely replace current map options, or just extend it,
  'newPlots' : {},
  'newLinks' : {},
  'deletedPlots: [],  // was opt.deletedPlots
  'deletedLinks' : [],  // was opt.deletedLinks
  'setLegendElemsState' => '...'  // was opt.setLegendElemsState
  'afterUpdate' => ...,  // was opt.afterUpdate
  'animDuration' : ...  // was opt.animDuration
};
$(".container").trigger('update', [options]);

Several questions:

  • shall it be backward compatible ? I think not. It would be hard to maintain.
  • what happened to resetPlots/resetAreas ? Actually, I never quite understood their purpose...
  • deletedPlots and deletedLinks could better be called to reflect what it is. Like DeletePlotNames and DeleteLinkNames?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions