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

Add links to State Of XYZ surveys #27

Open
captainbrosset opened this issue Oct 17, 2024 · 2 comments
Open

Add links to State Of XYZ surveys #27

captainbrosset opened this issue Oct 17, 2024 · 2 comments

Comments

@captainbrosset
Copy link
Contributor

@SachaG has recently been tagging his State Of data with web-features IDs, which now lets us cross-link the 2 data sets.
For the explorer, this means we could show the surveys that talk about a particular feature, and therefore make it easy to gauge developer interest and feedback in a particular feature.

One way to do this is by using GraphQL:

https://graphiql.devographics.com/

query MyQuery {
  entities(tags: "has_web_features_id") {
    id
    webFeaturesId
    appearsIn {
      survey {
        name
        editions {
          year
          resultsUrl
        }
      }
    }
  }
}
@captainbrosset
Copy link
Contributor Author

With the following query we can almost create URLs that point to specific questions about a feature:

query MyQuery {
  entities(tags: "has_web_features_id") {
    id
    webFeaturesId
    appearsIn {
      survey { name }
      edition { year }
      section {
        slug
        id
      }
    }
  }
}

By using the year, slug, and id fields in the above query, we can construct URLs like: <year>.stateof___.com/<slug>/<id>. It doesn't seem to work in all cases though. Not sure why yet.

@SachaG
Copy link

SachaG commented Nov 29, 2024

Oh right, the issue is that in some surveys (such as CSS 2024) all features appear as part of a combined chart, individual features don't have their own link:

Screenshot 2024-11-30 at 7 25 34

To solve this I think I would need to either create individual pages for all features outside of the main survey results; or else you would have to import all the data into the explorer and show it there without redirecting to the survey results.

The downside with that first approach is that we sometimes have 50+ features, and we build the site in 30+ languages. So that would add ~1500 extra pages to build on every deploy, which would slow things down a lot… So we probably need to wait until we switch to a system that supports page-per-page, incremental builds before that becomes practical.

If we go the other route, maybe the solution could be some kind of universal "State of XYZ chart" embed or web component? That could actually be pretty useful for bloggers and other sites too? But I've never built something like that so I'm not sure what's involved…

(By the way note that aside from the API, we also have static exports of all chart data available, although in this specific case we don't have exports for individual features yet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants