Ternary KDE contours?


I’ve been looking to create ternary plots using plotly in R with kernel density contours mixed with point data. I’ve searched around extensively and found a few examples that are very complex to replicate and themselves create errors when used. One of the images shown on https://plot.ly/r/ is a ternary diagram with what appears to be contours, but the example itself is just a simple ternaryscatter plot. Another more specific example is here:

Is there a function or plot type in the R implementation that can do this? Also, on the following github page there is mention of ‘ternary_contour’, but I guess it’s not implemented yet?

Thank you!