phetsims / natural-selection

"Natural Selection" is an educational simulation in HTML5, by PhET Interactive Simulations
GNU General Public License v3.0
3 stars 7 forks source link

Gene-related elements are featured differently for Intro vs Lab screen. #336

Closed pixelzoom closed 1 year ago

pixelzoom commented 1 year ago

Related to https://github.com/phetsims/natural-selection/issues/331 ...

The Intro screen shows only the fur gene, so only the elements related to fur are featured in natural-selection-overrides.js:

    "naturalSelection.introScreen.model.graphs.pedigreeModel.furAllelesVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.introScreen.model.graphs.populationModel.brownFurVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.introScreen.model.graphs.populationModel.dataPoints.brownFurPoints": {
      "phetioFeatured": true
    },
    "naturalSelection.introScreen.model.graphs.populationModel.dataPoints.whiteFurPoints": {
      "phetioFeatured": true
    },
    "naturalSelection.introScreen.model.graphs.populationModel.whiteFurVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.introScreen.model.graphs.proportionsModel.furVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.introScreen.view.graphs.proportionsNode.proportionsPanel.legendNode.furLegendNode.visibleProperty": {
      "phetioFeatured": true
    },

The Lab screen shows all genes (fur, teeth, ear), so elements for all genes are featured:

    "naturalSelection.labScreen.model.graphs.pedigreeModel.earsAllelesVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.pedigreeModel.furAllelesVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.pedigreeModel.teethAllelesVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.populationModel.brownFurVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.populationModel.dataPoints.brownFurPoints": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.populationModel.dataPoints.floppyEarsPoints": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.populationModel.dataPoints.longTeethPoints": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.populationModel.dataPoints.shortTeethPoints": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.populationModel.dataPoints.straightEarsPoints": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.populationModel.dataPoints.whiteFurPoints": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.populationModel.floppyEarsVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.populationModel.longTeethVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.populationModel.shortTeethVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.populationModel.straightEarsVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.populationModel.whiteFurVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.proportionsModel.earsVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.proportionsModel.furVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.model.graphs.proportionsModel.teethVisibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.view.graphs.proportionsNode.proportionsPanel.legendNode.earsLegendNode.visibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.view.graphs.proportionsNode.proportionsPanel.legendNode.furLegendNode.visibleProperty": {
      "phetioFeatured": true
    },
    "naturalSelection.labScreen.view.graphs.proportionsNode.proportionsPanel.legendNode.teethLegendNode.visibleProperty": {
      "phetioFeatured": true
    },

And this is currently really difficult to migrate from overrides.js into code. The problem is that the information about which genes are initially visible is not available to the model or view. The model always has the full set of genes, and GeneVisibilityManager manages the visibility of UI components, if the instructional designer chooses to show/hide genes via Studio/PhET-iO.

Since the ability to customize the sim in this way is a PhET-iO feature of the sim, I'd really like to make these things "featured" the same for both screens. I'll discuss with @amanda-phet.

pixelzoom commented 1 year ago

I should also not that that for most elements, all 3 genes are featured in both screens. For example, see genePool.*Gene, addMutationsPanel.*Row, allelesPanel.*Row, populationPanel.*Checkbox, and mutationAlertsNode.*MutationComingNode. So while I understand the motivation for what appears in overrides.js, it's inconsistent, and not what is done in the majority of cases. So I'm going to recommend featuring all genes in both screens.

@amanda-phet let's discuss.

amanda-phet commented 1 year ago

It seems consistent to just feature all mutations for both screens, when relevant.

pixelzoom commented 1 year ago

In the above commits, elements related to genes & alleles are now featured the same in both screens.

Closing.