Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: complete union/intersection options for parent_fault filtering and set sane defaults #38

Open
2 of 3 tasks
chrisbc opened this issue Jul 11, 2023 · 1 comment
Labels
API for project filtering solvis-graphql-api for project filtering

Comments

@chrisbc
Copy link
Member

chrisbc commented Jul 11, 2023

suggested sane defaults are:

  • location-radii: take the the intersection of sets for selected locations
  • parent fault: take the the union of sets for selected parent faults
  • for a combination of location + parent fault filters: take the intersection of the two sub-sets
@chrisbc
Copy link
Member Author

chrisbc commented Aug 1, 2023

it seems that intersection isn't default for locations ....

  $first: Int!
  $after: String
  $model_id: String!
  $fault_system: String!
  $location_ids: [String]!
  $radius_km: Int!
  $corupture_fault_names: [String]
  $minimum_mag: Float
  $maximum_mag: Float
  $minimum_rate: Float
  $maximum_rate: Float
  $sortby: [SimpleSortRupturesArgs]
) {
  textual_content_header: KORORAA_textual_content(index: "rupture_map_header.md") {
    ok
    content {
      content_type
      text
    }
  }
  SOLVIS_locations_by_id(location_ids: $location_ids) {
    edges {
      node {
        location_id
        name
        radius_geojson(radius_km: $radius_km, style: {stroke_color: "royalblue", stroke_width: 3, stroke_opacity: 1, fill_opacity: 0.01, fill_color: "royalblue"})
        id
      }
    }
  }
  SOLVIS_filter_rupture_sections(filter: {model_id: $model_id, location_ids: $location_ids, fault_system: $fault_system, corupture_fault_names: $corupture_fault_names, radius_km: $radius_km, minimum_mag: $minimum_mag, maximum_mag: $maximum_mag, minimum_rate: $minimum_rate, maximum_rate: $maximum_rate}) {
    model_id
    section_count
    fault_surfaces(style: {stroke_color: "silver", fill_color: "silver", fill_opacity: 0.25})
    fault_traces(color_scale: {name: "inferno"}, style: {stroke_width: 5})
    color_scale(name: "inferno") {
      name
      min_value
      max_value
      color_map {
        levels
        hexrgbs
      }
    }
    mfd_histogram {
      bin_center
      rate
      cumulative_rate
    }
  }
  SOLVIS_filter_ruptures(first: $first, after: $after, filter: {model_id: $model_id, fault_system: $fault_system, location_ids: $location_ids, radius_km: $radius_km, corupture_fault_names: $corupture_fault_names, minimum_mag: $minimum_mag, maximum_mag: $maximum_mag, minimum_rate: $minimum_rate, maximum_rate: $maximum_rate}, sortby: $sortby) {
    total_count
  }
  ...RuptureAnimationPage_queryRoot_2Ls9it
}

fragment RuptureAnimationPage_queryRoot_2Ls9it on Query {
  SOLVIS_filter_ruptures(first: $first, after: $after, filter: {model_id: $model_id, fault_system: $fault_system, location_ids: $location_ids, radius_km: $radius_km, corupture_fault_names: $corupture_fault_names, minimum_mag: $minimum_mag, maximum_mag: $maximum_mag, minimum_rate: $minimum_rate, maximum_rate: $maximum_rate}, sortby: $sortby) {
    pageInfo {
      hasNextPage
      endCursor
    }
    edges {
      node {
        fault_surfaces
        magnitude
        rate_weighted_mean
        area
        length
        id
        __typename
      }
      cursor
    }
  }
}

json:

{
    "first": 5,
    "after": null,
    "model_id": "NSHM_v1.0.4",
    "fault_system": "CRU",
    "location_ids": [
        "AKL",
        "ZQN"
    ],
    "radius_km": 50,
    "corupture_fault_names": [],
    "minimum_mag": 6,
    "maximum_mag": 10,
    "minimum_rate": 1.0000000000000001e-20,
    "maximum_rate": 1,
    "sortby": null
}

@chrisbc chrisbc added API for project filtering solvis-graphql-api for project filtering labels Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API for project filtering solvis-graphql-api for project filtering
Projects
None yet
Development

No branches or pull requests

1 participant