js graph select works with both styles