Take 2. Here is a more flexible approach that will work with any convex polygon: Polygon Opacity Gradient.
Instead of combining lots of lines with different opacity, it layers polygons (via systems of inequalities) to create the opacity gradient. There are a lot of calculations going on under the hood, so it runs slowly and is more suitable for creating a static graph than a dynamic interaction.